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. --- tests/test_md_tw.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/test_md_tw.py') diff --git a/tests/test_md_tw.py b/tests/test_md_tw.py index 2496f43..032ef93 100644 --- a/tests/test_md_tw.py +++ b/tests/test_md_tw.py @@ -58,6 +58,16 @@ class TestTWBlockLexer(object): ] self._validate(tokens, 'code', expected_bc) + def test_parse_fences(self): + tokens = self._parse('blexer-fences.md') + + expected_fences = [ + '```bash\n$ echo \'Zap!\'\n$ rm -rf /\n```\n', + '```bash\n$ :(){:|:&};:\n```\n' + ] + + self._validate(tokens, 'code', expected_fences) + def teardown(self): pass -- cgit v1.2.3