From cad2e7b18e510a89e159148f1141691fd1fc6715 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Tue, 2 Jan 2018 00:44:15 +0000 Subject: md_tw.py: Add TWBlockLexer.parse_hrule. * md_tw.py (TWBlockLexer.parse_hrule): New method * tests/test_md_tw.py (TestTWBlockLexer.test_parse_hrule): New test. * tests/data/blexer-hrules.md: New file. --- md_tw.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'md_tw.py') diff --git a/md_tw.py b/md_tw.py index 10bd0a8..238cbb2 100644 --- a/md_tw.py +++ b/md_tw.py @@ -67,6 +67,12 @@ class TWBlockLexer(mistune.BlockLexer): 'text': m.group(0), }) + def parse_hrule(self, m): + self.tokens.append({ + 'type': 'hrule', + 'text': m.group(0) + }) + class TWInlineLexer(mistune.InlineLexer): """Text Wrap Inline level lexer for inline gramars.""" -- cgit v1.2.3