sleemanj / xinha

WYSIWYG HTML Editor Component (turns <textarea> into HTML editors)
http://trac.xinha.org/
Other
13 stars 2 forks source link

Strange issue with the string 'graph' in the body of a xinha enabled text area (Trac #1589) #1589

Closed sleemanj closed 3 years ago

sleemanj commented 12 years ago

I have implemented the Xinha editor in a number of projects over many years and never noticed this issue before (that doesn't necessarily mean it wasn't there). In an instance where I have multiple editors on one page, if the text 'graph' is included anywhere in any of the editors (either on it's own or as part of another word such as 'photographic'), the currently enabled editor fails to load and I get a javascript error on the page as follows:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152) Timestamp: Tue, 29 Nov 2011 15:30:37 UTC

Message: 'parentNode' is null or not an object Line: 2635 Char: 3 Code: 0

If I remove or modify the text, everything works fine!! I have given this as a temporary workaround at the moment but, as you can understand, replacing "Graph" with "Chart" is much more acceptable than replacing "photographic" with "photografic"....

Unfortunately, I don't have any time at the moment to investigate further but thought it worthwhile to just raise here in case anyone has come across this or if it rings any bells with those of you that maintain or add to Xinha. I have searched the site without success.

When I get more time to investigate, if I find a resolution/root cause, i'll post an update here.

Reported by guest, migrated from http://trac.xinha.org/ticket/1589

sleemanj commented 12 years ago

@sleemanj commented:

Disable all Xinha plugins and then try.

There's no reason that simply the word "graph" would cause such a thing in the Xinha core that I can think of.

And for the love of all that is holy, use a proper browser when you debug, Chrome or Firefox.

sleemanj commented 12 years ago

guest commented:

I don't know who reported this, but I found the same issue and tracked it down to the Equation plugin (ASCIIMathML.js) at this line:

var am = /amath\b|graph/i.test(st);

I'm not sure about how to fix this properly, but for now I've just removed the graph test:

var am = /amath\b/i.test(st);

sleemanj commented 12 years ago

Probably 1342 fixes.