taoguan / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
0 stars 0 forks source link

Collapses instances of $$ to $ in the textarea #144

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a textarea containing "$ $$ $$$ $$$$"
2. run wysiwyg

What is the expected output? What do you see instead?
expected: "$ $$ $$$ $$$$"
instead: "$ $$ $$$ $$$$"

What version of the product are you using? On what operating system?
version 0.5 on multiple OSs with Firefox or Chrome (It works as expected in
IE8 because IE8 does not conform to the javascript standard on this)

Please provide any additional information below.
search for 'replace' in the code.
The line that does the replace assumes:
"A".replace("A","$ $$ $$$ $$$$") with produce "$ $$ $$$ $$$$" - it does
not, and according to the JavaScript spec it should not.
"A".replace("A",function(){return "$ $$ $$$ $$$$";}) however does product
what your after.

see https://bugzilla.mozilla.org/show_bug.cgi?id=531775 for background
information

Original issue reported on code.google.com by JackPDouglas@gmail.com on 30 Nov 2009 at 12:41

GoogleCodeExporter commented 8 years ago
patch could be something like this (not tested):

change line 442 
from:
                    .replace(/INITIAL_CONTENT/, this.initialContent)
to:
                    .replace(/INITIAL_CONTENT/, (function(t){return function(){
return t.initialContent}}(this)))

Original comment by JackPDouglas@gmail.com on 30 Nov 2009 at 12:48

GoogleCodeExporter commented 8 years ago

Original comment by akzhan.a...@gmail.com on 8 Dec 2009 at 8:52

GoogleCodeExporter commented 8 years ago

Original comment by akzhan.a...@gmail.com on 8 Dec 2009 at 9:14