Skip to content

Commit 7be017b

Browse files
committed
Include image tests.
1 parent 8afb1cd commit 7be017b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Tests/MarkdownKitTests/MarkdownHtmlTests.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,19 @@ class MarkdownHtmlTests: XCTestCase, MarkdownKitFactory {
6969
"<ul>\n<li><p>foo</p>\n</li>\n<li><p>bar</p>\n<ul>\n<li>one</li>\n<li>two</li>\n" +
7070
"<li>three</li>\n</ul>\n</li>\n<li><p>goo</p>\n</li>\n</ul>")
7171
}
72+
73+
func testImageLinks() {
74+
XCTAssertEqual(generateHtml("""
75+
This is an inline image: ![example *image*](folder/image.jpg "image title").
76+
"""),
77+
"<p>This is an inline image: <img src=\"folder/image.jpg\" alt=\"example image\"" +
78+
" title=\"image title\"/>.</p>")
79+
XCTAssertEqual(generateHtml("""
80+
This is an image block:
81+
82+
![example *image*](folder/image.jpg)
83+
"""),
84+
"<p>This is an image block:</p>\n" +
85+
"<p><img src=\"folder/image.jpg\" alt=\"example image\"/></p>")
86+
}
7287
}

0 commit comments

Comments
 (0)