Nowiki Include

Previously,
   <nowiki>[[!include foo]]</nowiki>
would produce some garbage, like
   chunk18226682includechunk
instead of the desired rendered text,
   [[!include foo]]

Fixed.
This commit is contained in:
Jacques Distler 2008-12-20 23:24:50 -06:00
parent 7828d79d35
commit dcd3e63ae8
2 changed files with 8 additions and 1 deletions

View file

@ -156,8 +156,9 @@ class WikiContent < String
def build_chunks
# create and mask Includes and "active_chunks" chunks
NoWiki.apply_to(self) if @options[:active_chunks].include?(NoWiki)
Include.apply_to(self)
@options[:active_chunks].each{|chunk_type| chunk_type.apply_to(self)}
@options[:active_chunks].each{|chunk_type| chunk_type.apply_to(self) unless chunk_type == NoWiki}
# Handle hiding contexts like "pre" and "code" etc..
# The markup (textile, rdoc etc) can produce such contexts with its own syntax.

View file

@ -12,6 +12,12 @@ class NoWikiTest < Test::Unit::TestCase
)
end
def test_include_nowiki
match(NoWiki, 'This sentence contains <nowiki>[[!include foo]]</nowiki>. Do not touch!',
:plain_text => '[[!include foo]]'
)
end
def test_markdown_nowiki
match(NoWiki, 'This sentence contains <nowiki>*raw text*</nowiki>. Do not touch!',
:plain_text => '*raw text*'