Multiline <nowiki> tag

This commit is contained in:
Alexey Verkhovsky 2005-05-06 01:02:30 +00:00
parent f77cf37f8e
commit a14430a285
3 changed files with 12 additions and 2 deletions

View file

@ -3,6 +3,8 @@
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
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:
Upgraded Rails to 0.12.0

View file

@ -15,7 +15,7 @@ require 'chunks/chunk'
# Created: 8th June 2004
class NoWiki < Chunk::Abstract
NOWIKI_PATTERN = Regexp.new('<nowiki>(.*?)</nowiki>')
NOWIKI_PATTERN = Regexp.new('<nowiki>(.*?)</nowiki>', Regexp::MULTILINE)
def self.pattern() NOWIKI_PATTERN end
attr_reader :plain_text

View file

@ -189,13 +189,21 @@ class RevisionTest < Test::Unit::TestCase
'This <IMG SRC="http://hobix.com/sample.jpg" alt=""> is an inline image link.')
end
def test_content_with_nowiki_text
def test_nowiki_tag
assert_markup_parsed_as(
'<p>Do not mark up [[this text]] or http://www.thislink.com.</p>',
'Do not mark up <nowiki>[[this text]]</nowiki> ' +
'or <nowiki>http://www.thislink.com</nowiki>.')
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
@web.brackets_only = true
assert_markup_parsed_as(