diff options
author | rsiddharth <s@ricketyspace.net> | 2018-01-02 00:41:45 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2018-01-02 00:41:45 +0000 |
commit | d78ac3764a90fc959862777f37fc9f175e5272e1 (patch) | |
tree | 9000027d64860dd1ede7ace083c29900b92eeebb /md_tw.py | |
parent | 06fd732f8d1b4b1d6ef7313df8f441009c781cd7 (diff) |
md_tw.py: Add TWBlockLexer.parse_lheading.
* md_tw.py
(TWBlockLexer.parse_lheading): New method.
* tests/test_md_tw.py
(TestTWBlockLexer.test_parse_lheading): New method.
* tests/data/blexer-lheading.md: New file.
Diffstat (limited to 'md_tw.py')
-rw-r--r-- | md_tw.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -59,6 +59,14 @@ class TWBlockLexer(mistune.BlockLexer): 'text': m.group(0), }) + def parse_lheading(self, m): + """Parse setext heading.""" + self.tokens.append({ + 'type': 'heading', + 'level': 1 if m.group(2) == '=' else 2, + 'text': m.group(0), + }) + class TWInlineLexer(mistune.InlineLexer): """Text Wrap Inline level lexer for inline gramars.""" |