From d78ac3764a90fc959862777f37fc9f175e5272e1 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Tue, 2 Jan 2018 00:41:45 +0000 Subject: 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. --- tests/data/blexer-lheading.md | 13 +++++++++++++ tests/test_md_tw.py | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/data/blexer-lheading.md (limited to 'tests') diff --git a/tests/data/blexer-lheading.md b/tests/data/blexer-lheading.md new file mode 100644 index 0000000..13a5160 --- /dev/null +++ b/tests/data/blexer-lheading.md @@ -0,0 +1,13 @@ +Milky Chance +============ + +Clemens, Phillipp, Antonio + +Flashed +------- + +Lost our mind. + +### Junk Mind + +In the junkyard. diff --git a/tests/test_md_tw.py b/tests/test_md_tw.py index af2ce45..a71c191 100644 --- a/tests/test_md_tw.py +++ b/tests/test_md_tw.py @@ -79,6 +79,17 @@ class TestTWBlockLexer(object): self._validate(tokens, 'heading', expected_hs) + def test_parse_lheading(self): + tokens = self._parse('blexer-lheading.md') + + expected_lhs = [ + 'Milky Chance\n============\n\n', + 'Flashed\n-------\n\n', + '### Junk Mind\n\n', + ] + + self._validate(tokens, 'heading', expected_lhs) + def teardown(self): pass -- cgit v1.2.3