aboutsummaryrefslogtreecommitdiff
path: root/test/writers
diff options
context:
space:
mode:
Diffstat (limited to 'test/writers')
-rw-r--r--test/writers/markdown-writer.tests.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/writers/markdown-writer.tests.js b/test/writers/markdown-writer.tests.js
index 6d078c5..e7ab9e1 100644
--- a/test/writers/markdown-writer.tests.js
+++ b/test/writers/markdown-writer.tests.js
@@ -90,6 +90,14 @@ test('elements with IDs have anchor tags with IDs appended to start of markdown
return assert.equal(writer.asString(), '# <a id="start"></a>Hello\n\n');
});
+test('anchor tag IDs are escaped', function() {
+ var writer = mdWriter.writer();
+ writer.open("h1", {id: "\"start\""});
+ writer.text("Hello");
+ writer.close("h1");
+ return assert.equal(writer.asString(), '# <a id="&quot;start&quot;"></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"});