diff options
author | rsiddharth <s@ricketyspace.net> | 2018-01-02 00:39:27 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2018-01-02 00:39:27 +0000 |
commit | 06fd732f8d1b4b1d6ef7313df8f441009c781cd7 (patch) | |
tree | c82af68dc039d800129b2fc3f9cf8e1456e26589 /md_tw.py | |
parent | a18df9d9adc54bbc8ea1f3b1a1c59f316667e840 (diff) |
md_tw: Add TWBlockLexer.parse_heading.
* md_tw.py
(TWBlockLexer.parse_heading): New method.
* tests/data/blexer-heading.md: New file.
* tests/test_md_tw.py
(TestTWBlockLexer.test_parse_heading): New test.
Diffstat (limited to 'md_tw.py')
-rw-r--r-- | md_tw.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -52,6 +52,13 @@ class TWBlockLexer(mistune.BlockLexer): 'text': m.group(0), }) + def parse_heading(self, m): + self.tokens.append({ + 'type': 'heading', + 'level': len(m.group(1)), + 'text': m.group(0), + }) + class TWInlineLexer(mistune.InlineLexer): """Text Wrap Inline level lexer for inline gramars.""" |