Merge branch 'master' into server-side-tex

This commit is contained in:
Joshua Peek
2011-11-28 13:21:46 -06:00
4 changed files with 146 additions and 74 deletions
+27 -21
View File
@@ -453,6 +453,12 @@ np.array([[2,2],[1,3]],np.float)
#
#########################################################################
test "strips javscript protocol urls" do
content = "[Hack me](javascript:hacked=true)"
output = "<p><a>Hackme</a></p>"
compare(content, output)
end
test "escaped wiki link" do
content = "a '[[Foo]], b"
output = "<p>a [[Foo]], b</p>"
@@ -492,29 +498,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
#########################################################################
#