From a18df9d9adc54bbc8ea1f3b1a1c59f316667e840 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Tue, 2 Jan 2018 00:37:33 +0000 Subject: md_tw.py: Add `TWBlockLexer.parse_fences`. * md_tw.py (TWBlockLexer.parse_fences): New method. * tests/data/blexer-fences.md: New file. * tests/test_md_tw.py (test_parse_fences): New test. --- md_tw.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'md_tw.py') diff --git a/md_tw.py b/md_tw.py index 7cb203b..218d324 100644 --- a/md_tw.py +++ b/md_tw.py @@ -45,6 +45,13 @@ class TWBlockLexer(mistune.BlockLexer): 'text': m.group(0), }) + def parse_fences(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.""" -- cgit v1.2.3