test/parser_test.rb in trac-wiki-0.3.18 vs test/parser_test.rb in trac-wiki-0.3.19
- old
+ new
@@ -273,9 +273,17 @@
tc "<p><a href=\"BASE/link\">link</a></p>\n", "[[link]]", base: 'BASE'
tc "<p><a href=\"BASE/link\">link</a></p>\n", "[[link]]", base: 'BASE/'
tc "<p><a href=\"link#link\">link#link</a></p>\n", "[[link#link]]"
tc "<p><a href=\"#link\">#link</a></p>\n", "[[#link]]"
+ tc "<p><a href=\"BASE/link\">link</a></p>\n", "[[link]]", base: 'BASE', root: 'ROOT', no_escape: true
+ tc "<p><a href=\"ROOT/link\">/link</a></p>\n", "[[/link]]", base: 'BASE', root: 'ROOT', no_escape: true
+ tc "<p><a href=\"/link\">/link</a></p>\n", "[[/link]]", base: 'BASE', no_escape: true
+
+ tc "<p><a href=\"BASE/link\">bla</a></p>\n", "[[link | bla ]]", base: 'BASE', root: 'ROOT', no_escape: true
+ tc "<p><a href=\"ROOT/link\">bla</a></p>\n", "[[/link | bla ]]", base: 'BASE', root: 'ROOT', no_escape: true
+ tc "<p><a href=\"/link\">bla</a></p>\n", "[[/link | bla]]", base: 'BASE', no_escape: true
+
# Links can appear in paragraphs (i.e. inline item)
tc "<p>Hello, <a href=\"world\">world</a></p>\n", "Hello, [[world]]"
# Named links
tc "<p><a href=\"MyBigPage\">Go to my page</a></p>\n", "[[MyBigPage|Go to my page]]"