A Real Fix For the "Backslashes in Included Equations" Bug

Ruby's String.sub!(pattern, replacement) routine is fundamentally
broken. But the block version works fine.

Using the broken routine in the Chunk handler was a subtle mistake.
This commit is contained in:
Jacques Distler 2009-01-17 00:28:38 -06:00
parent 294ac909c4
commit 13b7e1d766

View file

@ -61,7 +61,7 @@ module Chunk
end end
def unmask def unmask
@content.sub!(mask, @unmask_text) @content.sub!(/#{mask}/){|s| s.replace @unmask_text}
end end
def rendered? def rendered?
@ -73,7 +73,7 @@ module Chunk
end end
def revert def revert
@content.sub!(mask, @text) @content.sub!(/#{mask}/){|s| s.replace @text}
# unregister # unregister
@content.delete_chunk(self) @content.delete_chunk(self)
end end