add id to whitelisted attributes. The transformers still seem to work and prefix ids with wiki-. Uncommented relevant tests.

This commit is contained in:
Jussi Malinen
2012-04-23 20:08:24 +03:00
parent 4cd3fdcdba
commit 02073f827b
2 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ module Gollum
'compact', 'coords', 'datetime', 'dir',
'disabled', 'enctype', 'for', 'frame',
'headers', 'height', 'hreflang',
'hspace', 'ismap', 'label', 'lang',
'hspace', 'id', 'ismap', 'label', 'lang',
'longdesc', 'maxlength', 'media', 'method',
'multiple', 'name', 'nohref', 'noshade',
'nowrap', 'prompt', 'readonly', 'rel', 'rev',
+21 -21
View File
@@ -546,29 +546,29 @@ np.array([[2,2],[1,3]],np.float)
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 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\" id=\"wiki-fnr1\"><a href=\"#wiki-fn1\">1</a></sup></h2>" +
# "\n<p class=\"footnote\" id=\"wiki-fn1\"><a href=\"#wiki-fnr1\"><sup>1</sup></a> footnote</p>"
# 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\" id=\"wiki-fnr1\"><a href=\"#wiki-fn1\">1</a></sup></h2>" +
"\n<p class=\"footnote\" id=\"wiki-fn1\"><a href=\"#wiki-fnr1\"><sup>1</sup></a> footnote</p>"
compare(content, output, :textile)
end
# test "name prefix added" do
# content = "abc\n\n__TOC__\n\n==Header==\n\nblah"
# compare content, '', :mediawiki, [
# /id="wiki-toc"/,
# /href="#wiki-Header"/,
# /id="wiki-Header"/,
# /name="wiki-Header"/
# ]
# end
test "name prefix added" do
content = "abc\n\n__TOC__\n\n==Header==\n\nblah"
compare content, '', :mediawiki, [
/id="wiki-toc"/,
/href="#wiki-Header"/,
/id="wiki-Header"/,
/name="wiki-Header"/
]
end
#########################################################################
#