allow @id attributes but force a "wiki-" prefix

This commit is contained in:
Schuyler Duveen
2011-05-04 11:50:38 -04:00
parent 748d76dff1
commit c22050fca8
2 changed files with 45 additions and 1 deletions
+14
View File
@@ -467,6 +467,20 @@ context "Markup" do
compare(content, output, 'org')
end
test "id with prefix ok" do
content = "h2(example#wiki-foo). xxxx"
output = %(<h2 class="example" id="wiki-foo">xxxx</h2>)
compare(content, output, :textile)
end
test "id prefix added" do
content = "h2(#foo). xxxx[1]\n\nfn1.footnote"
output = "<h2 id=\"wiki-foo\">xxxx" +
"<sup class=\"footnote\"><a href=\"#wiki-fn1\">1</a></sup></h2>" +
"\n<p class=\"footnote\" id=\"wiki-fn1\"><sup>1</sup> footnote</p>"
compare(content, output, :textile)
end
#########################################################################
#
# TeX