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:
parent
7828d79d35
commit
dcd3e63ae8
|
@ -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.
|
||||
|
|
|
@ -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*'
|
||||
|
|
Loading…
Reference in a new issue