diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/writers/markdown_tests.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/writers/markdown_tests.py b/tests/writers/markdown_tests.py index cb91905..af0f9d2 100644 --- a/tests/writers/markdown_tests.py +++ b/tests/writers/markdown_tests.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mammoth.writers.markdown import MarkdownWriter +from mammoth.writers.markdown import MarkdownWriter, _escape_markdown from ..testing import assert_equal @@ -208,6 +208,17 @@ def test_numbering_is_separate_for_nested_list_and_parent_list(): assert_equal("1. Fruit\n\t1. Apple\n\t2. Banana\n2. Condiments\n\n", writer.as_string()) +def test_html_tag_characters_are_escaped(): + escaped = _escape_markdown("<br/>") + + assert_equal(r"\<br/\>", escaped) + + +def test_html_entity_characters_are_escaped(): + escaped = _escape_markdown("&") + + assert_equal(r"\&", escaped) + def _create_writer(): return MarkdownWriter() |
