diff --git a/lib/wiki_content.rb b/lib/wiki_content.rb index 5ed9768c..9c5405a2 100644 --- a/lib/wiki_content.rb +++ b/lib/wiki_content.rb @@ -120,6 +120,7 @@ class WikiContent < String DEFAULT_OPTS = { :active_chunks => ACTIVE_CHUNKS, + :hide_chunks => HIDE_CHUNKS, :engine => Engines::MarkdownMML, :engine_opts => [], :mode => :show @@ -138,6 +139,8 @@ class WikiContent < String @options[:engine] = Engines::MAP[@web.markup] @options[:engine_opts] = [:filter_html, :filter_styles] if @web.safe_mode? @options[:active_chunks] = (ACTIVE_CHUNKS - [WikiChunk::Word] ) if @web.brackets_only? + @options[:hide_chunks] = (HIDE_CHUNKS - [Literal::Math] ) unless + [Engines::MarkdownMML, Engines::MarkdownPNG].include?(@options[:engine]) @not_rendered = @pre_rendered = nil @@ -169,7 +172,7 @@ class WikiContent < String copy = WikiContentStub.new(self, @web, @options) @options[:engine].apply_to(copy) - copy.inside_chunks(HIDE_CHUNKS) do |id| + copy.inside_chunks(@options[:hide_chunks]) do |id| @chunks_by_id[id.to_i].revert end end diff --git a/test/unit/page_renderer_test.rb b/test/unit/page_renderer_test.rb index 0da31ac1..fae92830 100644 --- a/test/unit/page_renderer_test.rb +++ b/test/unit/page_renderer_test.rb @@ -330,6 +330,15 @@ END_THM "should we go ThatWay or $ThisWay$.") end + def test_content_with_wikiword_in_equations_textile + set_web_property :markup, :textile + assert_markup_parsed_as( + "

$$foo?" + + "$$
$foo?$

", + "$$[[foo]]$$\n$[[foo]]$") + end + # wikiwords are invalid as styles, must be in "name: value" form def test_content_with_wikiword_in_style_tag assert_markup_parsed_as(