220 (r'^( *\.\.)(\s*)(\|.+\|)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))', |
220 (r'^( *\.\.)(\s*)(\|.+\|)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))', |
221 bygroups(Punctuation, Text, Name.Tag, Text, Operator.Word, |
221 bygroups(Punctuation, Text, Name.Tag, Text, Operator.Word, |
222 Punctuation, Text, using(this, state='inline'))), |
222 Punctuation, Text, using(this, state='inline'))), |
223 # Comments |
223 # Comments |
224 (r'^ *\.\..*(\n( +.*\n|\n)+)?', Comment.Preproc), |
224 (r'^ *\.\..*(\n( +.*\n|\n)+)?', Comment.Preproc), |
225 # Field list |
225 # Field list marker |
226 (r'^( *)(:[a-zA-Z-]+:)(\s*)$', bygroups(Text, Name.Class, Text)), |
226 (r'^( *)(:(?:\\\\|\\:|[^:\n])+:(?=\s))([ \t]*)', |
227 (r'^( *)(:.*?:)([ \t]+)(.*?)$', |
227 bygroups(Text, Name.Class, Text)), |
228 bygroups(Text, Name.Class, Text, Name.Function)), |
|
229 # Definition list |
228 # Definition list |
230 (r'^(\S.*(?<!::)\n)((?:(?: +.*)\n)+)', |
229 (r'^(\S.*(?<!::)\n)((?:(?: +.*)\n)+)', |
231 bygroups(using(this, state='inline'), using(this, state='inline'))), |
230 bygroups(using(this, state='inline'), using(this, state='inline'))), |
232 # Code blocks |
231 # Code blocks |
233 (r'(::)(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\3.*|)\n)+)', |
232 (r'(::)(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\3.*|)\n)+)', |
580 (r'`[^`]+`', String.Backtick), |
579 (r'`[^`]+`', String.Backtick), |
581 # mentions and topics (twitter and github stuff) |
580 # mentions and topics (twitter and github stuff) |
582 (r'[@#][\w/:]+', Name.Entity), |
581 (r'[@#][\w/:]+', Name.Entity), |
583 # (image?) links eg:  |
582 # (image?) links eg:  |
584 (r'(!?\[)([^]]+)(\])(\()([^)]+)(\))', bygroups(Text, Name.Tag, Text, Text, Name.Attribute, Text)), |
583 (r'(!?\[)([^]]+)(\])(\()([^)]+)(\))', bygroups(Text, Name.Tag, Text, Text, Name.Attribute, Text)), |
|
584 # reference-style links, e.g.: |
|
585 # [an example][id] |
|
586 # [id]: http://example.com/ |
|
587 (r'(\[)([^]]+)(\])(\[)([^]]*)(\])', bygroups(Text, Name.Tag, Text, Text, Name.Label, Text)), |
|
588 (r'^(\s*\[)([^]]*)(\]:\s*)(.+)', bygroups(Text, Name.Label, Text, Name.Attribute)), |
585 |
589 |
586 # general text, must come last! |
590 # general text, must come last! |
587 (r'[^\\\s]+', Text), |
591 (r'[^\\\s]+', Text), |
588 (r'.', Text), |
592 (r'.', Text), |
589 ], |
593 ], |