aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-02-08 20:36:38 +0000
committerMichael Williamson <mike@zwobble.org>2015-02-08 20:36:38 +0000
commit6a36ee5303addbf1ce5f95dfa5e4c0d419cf1d9d (patch)
treeb145242421ae0dc46f0e9f807a9e9e93e8af3b4c /tests
parent54827b4def89b5c0135fd90507665c76ae2a2efd (diff)
Handle img elements in markdown writer
Diffstat (limited to 'tests')
-rw-r--r--tests/writers/markdown_tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/writers/markdown_tests.py b/tests/writers/markdown_tests.py
index 82131b4..dd25818 100644
--- a/tests/writers/markdown_tests.py
+++ b/tests/writers/markdown_tests.py
@@ -110,6 +110,13 @@ def links_have_anchors_before_opening_square_bracket():
writer.text("Hello")
writer.end("a")
assert_equal('<a id="start"></a>[Hello](http://example.com)', writer.as_string())
+
+
+@istest
+def image_elements_are_written_as_markdown_images():
+ writer = _create_writer()
+ writer.self_closing("img", {"src": "http://example.com/image.jpg", "alt": "Alt Text"})
+ assert_equal("![Alt Text](http://example.com/image.jpg)", writer.as_string())
def _create_writer():