diff --git a/lib/wiki_content.rb b/lib/wiki_content.rb index 5ed9768c..5f04fb09 100644 --- a/lib/wiki_content.rb +++ b/lib/wiki_content.rb @@ -177,7 +177,8 @@ class WikiContent < String def pre_render! unless @pre_rendered @chunks_by_type[Include].each{|chunk| chunk.unmask } - @pre_rendered = String.new(self) + @pre_rendered = String.new + @pre_rendered = self end @pre_rendered end diff --git a/test/unit/page_renderer_test.rb b/test/unit/page_renderer_test.rb index c4093538..0da31ac1 100644 --- a/test/unit/page_renderer_test.rb +++ b/test/unit/page_renderer_test.rb @@ -626,6 +626,17 @@ END_THM test_renderer(main).display_content_for_export end + def test_rendering_included_page_backslashes_in_equations + included = @web.add_page('Included', '\\\\ $\begin{matrix} a \\\\ b\end{matrix}$', Time.now, 'AnAuthor', test_renderer) + main = @web.add_page('Main', '[[!include Included]]', Time.now, 'AnAuthor', test_renderer) + + assert_equal "
\\
", + test_renderer(main).display_content + end + private def add_sample_pages