aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-02-04 19:44:23 +0000
committerMichael Williamson <mike@zwobble.org>2015-02-04 19:44:23 +0000
commite1dff535b2a9f59c852c2d9cbe2cecb28768cdec (patch)
treef831ccfeb19a0e01a8b1b81a9c8cfac364e057d9 /tests
parent6189b03ede982d4ee19e8972dc134f7f708aa8fc (diff)
Handle anchors properly for links
Diffstat (limited to 'tests')
-rw-r--r--tests/writers/markdown-writer.tests.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/writers/markdown-writer.tests.js b/tests/writers/markdown-writer.tests.js
index 7912acf..250bb0c 100644
--- a/tests/writers/markdown-writer.tests.js
+++ b/tests/writers/markdown-writer.tests.js
@@ -91,6 +91,14 @@ describe('markdown-writer', function() {
return assert.equal(writer.asString(), '# <a id="start"></a>Hello\n\n');
});
+ test('links have anchors before opening square bracket', function() {
+ var writer = mdWriter.writer();
+ writer.open("a", {href: "http://example.com", id: "start"});
+ writer.text("Hello");
+ writer.close("a");
+ return assert.equal(writer.asString(), '<a id="start"></a>[Hello](http://example.com)');
+ });
+
test('can generate images', function() {
var writer = mdWriter.writer();
writer.selfClosing("img", { "src": "http://example.com/image.jpg", "alt": "Alt Text" });