Fix the "Backslashes in Included Equations" Bug
See http://golem.ph.utexas.edu/instiki/revision/Known+Bugs?rev=3#IncludedEqs Who knew that @pre_rendered = String.new(self) was not the same as @pre_rendered = String.new @pre_rendered = self ?
This commit is contained in:
parent
074711d4c5
commit
41006d20ef
|
@ -177,7 +177,8 @@ class WikiContent < String
|
||||||
def pre_render!
|
def pre_render!
|
||||||
unless @pre_rendered
|
unless @pre_rendered
|
||||||
@chunks_by_type[Include].each{|chunk| chunk.unmask }
|
@chunks_by_type[Include].each{|chunk| chunk.unmask }
|
||||||
@pre_rendered = String.new(self)
|
@pre_rendered = String.new
|
||||||
|
@pre_rendered = self
|
||||||
end
|
end
|
||||||
@pre_rendered
|
@pre_rendered
|
||||||
end
|
end
|
||||||
|
|
|
@ -626,6 +626,17 @@ END_THM
|
||||||
test_renderer(main).display_content_for_export
|
test_renderer(main).display_content_for_export
|
||||||
end
|
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 "<p>\\ <math class='maruku-mathml' display='inline' " +
|
||||||
|
"xmlns='http://www.w3.org/1998/Math/MathML'><mrow><mtable rowspacing='0.5ex'>" +
|
||||||
|
"<mtr><mtd><mi>a</mi></mtd></mtr> <mtr><mtd><mi>b</mi></mtd></mtr></mtable>" +
|
||||||
|
"</mrow></math></p>",
|
||||||
|
test_renderer(main).display_content
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def add_sample_pages
|
def add_sample_pages
|
||||||
|
|
Loading…
Reference in a new issue