diff options
author | rsiddharth <s@ricketyspace.net> | 2018-01-02 00:34:32 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2018-01-02 00:36:38 +0000 |
commit | d9d4e31636da136be3a8dd60d507140e03c0cf6c (patch) | |
tree | 03b7a0debff2e636196b1c0d6a29ffcbed1f162c /md_tw.py | |
parent | 9df739fcf2e837d0131c8d468564b46f8c7adb98 (diff) |
md_tw.py: Add `TWBlockLexer.parse_block_code`.
* md_tw.py
(TWBlockLexer.parse_block_code): New method.
* tests/test_md_tw.py
(TestTWBlockLexer._parse)
(TestTWBlockLexer._validate): New private methods.
(TestTWBlockLexer.test_parse_block_code): New test.
* tests/data/blexer-block-code.md: New file.
Diffstat (limited to 'md_tw.py')
-rw-r--r-- | md_tw.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -38,6 +38,13 @@ class TWBlockLexer(mistune.BlockLexer): key = mistune.escape(key.lower(), quote=True) return self._key_pattern.sub(' ', key) + def parse_block_code(self, m): + self.tokens.append({ + 'type': 'code', + 'lang': None, + 'text': m.group(0), + }) + class TWInlineLexer(mistune.InlineLexer): """Text Wrap Inline level lexer for inline gramars.""" |