Multiline <nowiki> tag
This commit is contained in:
parent
f77cf37f8e
commit
a14430a285
3 changed files with 12 additions and 2 deletions
|
@ -3,6 +3,8 @@
|
||||||
Added layout=no option to the export_html action (it exports page contents processed
|
Added layout=no option to the export_html action (it exports page contents processed
|
||||||
by the markup engine, but without the default layout - so that they can be wrapper in
|
by the markup engine, but without the default layout - so that they can be wrapper in
|
||||||
some other layout)
|
some other layout)
|
||||||
|
<nowiki> tag can span several lines (before it was applied when both opening and closing
|
||||||
|
tags were on the same line only)
|
||||||
|
|
||||||
* 0.10.1:
|
* 0.10.1:
|
||||||
Upgraded Rails to 0.12.0
|
Upgraded Rails to 0.12.0
|
||||||
|
|
|
@ -15,7 +15,7 @@ require 'chunks/chunk'
|
||||||
# Created: 8th June 2004
|
# Created: 8th June 2004
|
||||||
class NoWiki < Chunk::Abstract
|
class NoWiki < Chunk::Abstract
|
||||||
|
|
||||||
NOWIKI_PATTERN = Regexp.new('<nowiki>(.*?)</nowiki>')
|
NOWIKI_PATTERN = Regexp.new('<nowiki>(.*?)</nowiki>', Regexp::MULTILINE)
|
||||||
def self.pattern() NOWIKI_PATTERN end
|
def self.pattern() NOWIKI_PATTERN end
|
||||||
|
|
||||||
attr_reader :plain_text
|
attr_reader :plain_text
|
||||||
|
|
|
@ -189,13 +189,21 @@ class RevisionTest < Test::Unit::TestCase
|
||||||
'This <IMG SRC="http://hobix.com/sample.jpg" alt=""> is an inline image link.')
|
'This <IMG SRC="http://hobix.com/sample.jpg" alt=""> is an inline image link.')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_content_with_nowiki_text
|
def test_nowiki_tag
|
||||||
assert_markup_parsed_as(
|
assert_markup_parsed_as(
|
||||||
'<p>Do not mark up [[this text]] or http://www.thislink.com.</p>',
|
'<p>Do not mark up [[this text]] or http://www.thislink.com.</p>',
|
||||||
'Do not mark up <nowiki>[[this text]]</nowiki> ' +
|
'Do not mark up <nowiki>[[this text]]</nowiki> ' +
|
||||||
'or <nowiki>http://www.thislink.com</nowiki>.')
|
'or <nowiki>http://www.thislink.com</nowiki>.')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_multiline_nowiki_tag
|
||||||
|
assert_markup_parsed_as(
|
||||||
|
"<p>Do not mark \n up [[this text]] \nand http://this.url.com but markup " +
|
||||||
|
'<span class="newWikiWord">this<a href="../show/this">?</a></span></p>',
|
||||||
|
"Do not <nowiki>mark \n up [[this text]] \n" +
|
||||||
|
"and http://this.url.com </nowiki> but markup [[this]]")
|
||||||
|
end
|
||||||
|
|
||||||
def test_content_with_bracketted_wiki_word
|
def test_content_with_bracketted_wiki_word
|
||||||
@web.brackets_only = true
|
@web.brackets_only = true
|
||||||
assert_markup_parsed_as(
|
assert_markup_parsed_as(
|
||||||
|
|
Loading…
Add table
Reference in a new issue