[RESTORES BUILD] Wiki link (in double square brackets) has precedence over autolinking URLs;
contents of wiki links are not passed to markup engines; got rid of bracketing mask method in the chunks parser (it was a feature that caused a lot of parsing grief for no good reason)
This commit is contained in:
parent
301464c4e4
commit
8263e4bfcd
6 changed files with 32 additions and 37 deletions
|
@ -16,7 +16,7 @@ class RevisionTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
@revision = Revision.new(@page, 1,
|
||||
'HisWay would be MyWay in kinda ThatWay in HisWay though MyWay \\OverThere -- ' +
|
||||
'HisWay would be MyWay in kinda ThatWay in HisWay though MyWay \OverThere -- ' +
|
||||
'see SmartEngine in that SmartEngineGUI',
|
||||
Time.local(2004, 4, 4, 16, 50), 'DavidHeinemeierHansson')
|
||||
end
|
||||
|
@ -40,7 +40,7 @@ class RevisionTest < Test::Unit::TestCase
|
|||
'<span class="newWikiWord">His Way<a href="../show/HisWay">?</a></span> ' +
|
||||
'though <a class="existingWikiWord" href="../show/MyWay">My Way</a> OverThere—see ' +
|
||||
'<a class="existingWikiWord" href="../show/SmartEngine">Smart Engine</a> in that ' +
|
||||
'<span class="newWikiWord">Smart Engine <span class="caps">GUI</span>' +
|
||||
'<span class="newWikiWord">Smart Engine GUI' +
|
||||
'<a href="../show/SmartEngineGUI">?</a></span></p>',
|
||||
@revision.display_content
|
||||
end
|
||||
|
@ -108,6 +108,11 @@ class RevisionTest < Test::Unit::TestCase
|
|||
'That is some <em style="WikiWord">Stylish Emphasis</em>')
|
||||
end
|
||||
|
||||
def test_content_with_escaped_wikiword
|
||||
# there should be no wiki link
|
||||
assert_markup_parsed_as('<p>WikiWord</p>', '\WikiWord')
|
||||
end
|
||||
|
||||
def test_content_with_pre_blocks
|
||||
assert_markup_parsed_as(
|
||||
'A <code>class SmartEngine end</code> would not mark up <pre>CodeBlocks</pre>',
|
||||
|
@ -155,7 +160,7 @@ class RevisionTest < Test::Unit::TestCase
|
|||
'<span class="newWikiWord">His Way</span> though ' +
|
||||
'<a class="existingWikiWord" href="MyWay.html">My Way</a> OverThere—see ' +
|
||||
'<a class="existingWikiWord" href="SmartEngine.html">Smart Engine</a> in that ' +
|
||||
'<span class="newWikiWord">Smart Engine <span class="caps">GUI</span></span></p>',
|
||||
'<span class="newWikiWord">Smart Engine GUI</span></p>',
|
||||
@revision.display_content_for_export
|
||||
end
|
||||
|
||||
|
@ -179,8 +184,8 @@ class RevisionTest < Test::Unit::TestCase
|
|||
|
||||
def test_difficult_wiki_words
|
||||
@revision.content = "[[It's just awesome GUI!]]"
|
||||
assert_equal "<p><span class=\"newWikiWord\">It’s just awesome <span class=\"caps\">GUI" +
|
||||
"</span>!<a href=\"../show/It%27s+just+awesome+GUI%21\">?</a></span></p>",
|
||||
assert_equal "<p><span class=\"newWikiWord\">It's just awesome GUI!" +
|
||||
"<a href=\"../show/It%27s+just+awesome+GUI%21\">?</a></span></p>",
|
||||
@revision.display_content
|
||||
end
|
||||
|
||||
|
@ -205,7 +210,7 @@ class RevisionTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_link_to_pic
|
||||
assert_markup_parsed_as(
|
||||
assert_markup_parsed_as(
|
||||
'<p><img alt="Square" src="../pic/square.jpg" /></p>',
|
||||
'[[square.jpg|Square:pic]]')
|
||||
assert_markup_parsed_as(
|
||||
|
|
|
@ -84,7 +84,7 @@ class WebTest < Test::Unit::TestCase
|
|||
|
||||
# Escaping special characters in the name
|
||||
assert_equal(
|
||||
'<span class="newWikiWord">Smith & Wesson<a href="../show/Smith+%26+Wesson">?</a></span>',
|
||||
'<span class="newWikiWord">Smith & Wesson<a href="../show/Smith+%26+Wesson">?</a></span>',
|
||||
@web.make_link('Smith & Wesson'))
|
||||
|
||||
# optionally using text as the link text
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue