eric6/ThirdParty/Pygments/pygments/lexers/markup.py

changeset 7547
21b0534faebc
parent 6942
2602857055c5
child 7701
25f42e208e08
equal deleted inserted replaced
7546:bf5f777260a6 7547:21b0534faebc
3 pygments.lexers.markup 3 pygments.lexers.markup
4 ~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for non-HTML markup languages. 6 Lexers for non-HTML markup languages.
7 7
8 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 import re 12 import re
13 13
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: ![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png) 582 # (image?) links eg: ![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png)
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 ],

eric ide

mercurial