From 06fd732f8d1b4b1d6ef7313df8f441009c781cd7 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Tue, 2 Jan 2018 00:39:27 +0000 Subject: 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. --- tests/data/blexer-heading.md | 11 +++++++++++ tests/test_md_tw.py | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/data/blexer-heading.md (limited to 'tests') diff --git a/tests/data/blexer-heading.md b/tests/data/blexer-heading.md new file mode 100644 index 0000000..382896d --- /dev/null +++ b/tests/data/blexer-heading.md @@ -0,0 +1,11 @@ +# 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 032ef93..af2ce45 100644 --- a/tests/test_md_tw.py +++ b/tests/test_md_tw.py @@ -68,6 +68,17 @@ class TestTWBlockLexer(object): self._validate(tokens, 'code', expected_fences) + def test_parse_heading(self): + tokens = self._parse('blexer-heading.md') + + expected_hs = [ + '# Milky Chance\n\n', + '## Flashed\n\n', + '### Junk Mind\n\n', + ] + + self._validate(tokens, 'heading', expected_hs) + def teardown(self): pass -- cgit v1.2.3