Class BlockGrammar

Inheritance Relationships

Base Type

  • public object

Class Documentation

class BlockGrammar

Grammars for block level tokens.

Public Static Attributes

pymdtools.mistunege.BlockGrammar.def_links= re.compile( r'^ *[([^^]]+)]: *' # [key]: r'<?([^s>]+)>?' # <link> or link r'(?: +["(]([^n]+)[")])? *(?:n+|$)' )
pymdtools.mistunege.BlockGrammar.def_footnotes= re.compile( r'^[^([^]]+)]: *(' r'[^n]*(?:n+|$)' # [^key]: r'(?: {1,}[^n]*(?:n+|$))*' r')' )
pymdtools.mistunege.BlockGrammar.newline = re.compile(r'^n+')
pymdtools.mistunege.BlockGrammar.block_code = re.compile(r'^( {4}[^n]+n*)+')
pymdtools.mistunege.BlockGrammar.fences= re.compile( r'^ *(`{3,}|~{3,}) *(S+)? *n' # ```lang r'([sS]+?)s*' r'1 *(?:n+|$)' # ``` )
pymdtools.mistunege.BlockGrammar.hrule = re.compile(r'^ {0,3}[-*_](?: *[-*_]){2,} *(?:n+|$)')
pymdtools.mistunege.BlockGrammar.heading = re.compile(r'^ *(#{1,6}) *([^n]+?) *#* *(?:n+|$)')
pymdtools.mistunege.BlockGrammar.lheading = re.compile(r'^([^n]+)n *(=|-)+ *(?:n+|$)')
pymdtools.mistunege.BlockGrammar.block_quote = re.compile(r'^( *>[^n]+(n[^n]+)*n*)+')
pymdtools.mistunege.BlockGrammar.list_block= re.compile( r'^( *)([*+-]|d+.) [sS]+?' r'(?:' r'n+(?=1?(?:[-*_] *){3,}(?:n+|$))' # hrule r'|n+(?=%s)' # def links r'|n+(?=%s)' # def footnotes r'|n{2,}' r'(?! )' r'(?!1(?:[*+-]|d+.) )n*' r'|' r's*$)' % ( _pure_pattern(def_links), _pure_pattern(def_footnotes), ) )
pymdtools.mistunege.BlockGrammar.list_item= re.compile( r'^(( *)(?:[*+-]|d+.) [^n]*' r'(?:n(?!2(?:[*+-]|d+.) )[^n]*)*)', flags=re.M )
pymdtools.mistunege.BlockGrammar.list_bullet = re.compile(r'^ *(?:[*+-]|d+.) +')
pymdtools.mistunege.BlockGrammar.paragraph= re.compile( r'^((?:[^n]+n?(?!' r'%s|%s|%s|%s|%s|%s|%s|%s|%s' r'))+)n*' % ( _pure_pattern(fences).replace(r'1', r'2'), _pure_pattern(list_block).replace(r'1', r'3'), _pure_pattern(hrule), _pure_pattern(heading), _pure_pattern(lheading), _pure_pattern(block_quote), _pure_pattern(def_links), _pure_pattern(def_footnotes), '<' + _block_tag, ) )
pymdtools.mistunege.BlockGrammar.block_html= re.compile( r'^ *(?:%s|%s|%s) *(?:n{2,}|s*$)' % ( r'<!--[sS]*?-->', r'<(%s)((?:%s)*?)>([sS]*?)</1>' % (_block_tag, _valid_attr), r'<%s(?:%s)*?s*/?>' % (_block_tag, _valid_attr), ) )
pymdtools.mistunege.BlockGrammar.table= re.compile( r'^ *|(.+)n *|( *[-:]+[-| :]*)n((?: *|.*(?:n|$))*)n*' )
pymdtools.mistunege.BlockGrammar.nptable= re.compile( r'^ *(S.*|.*)n *([-:]+ *|[-| :]*)n((?:.*|.*(?:n|$))*)n*' )
pymdtools.mistunege.BlockGrammar.text = re.compile(r'^[^n]+')