HowardMarks
MIS
Hi,
Not sure if this is right forum but I have a problem with innerHTML.
I am using a content-editable div within a content management application. The user can edit their details with the wysiwyg editor and put in bolds, hyperlinks etc.
The div can also be changed to display the raw html by clicking a button.
On submission of the form, my code looks at what type of content is within the div, if it is raw HTML it takes the innerText, and if it is WYSIWYG it takes the innerHTML.
This is where my problem occurs - the conversion to innerHTML automatically converts the characters to their html equivalents. This is good in most ways, but it is messing up my links. On a second submission of pre-saved html, The "s within the <a> tag are replaced with '" which breaks the links.
I cannot find a solution to this anywhere, and I am thinking that regular expressions could be the only answer.
Does anyone have an ideas?
Nick (Webmaster)
info@npfx.com
Not sure if this is right forum but I have a problem with innerHTML.
I am using a content-editable div within a content management application. The user can edit their details with the wysiwyg editor and put in bolds, hyperlinks etc.
The div can also be changed to display the raw html by clicking a button.
On submission of the form, my code looks at what type of content is within the div, if it is raw HTML it takes the innerText, and if it is WYSIWYG it takes the innerHTML.
This is where my problem occurs - the conversion to innerHTML automatically converts the characters to their html equivalents. This is good in most ways, but it is messing up my links. On a second submission of pre-saved html, The "s within the <a> tag are replaced with '" which breaks the links.
I cannot find a solution to this anywhere, and I am thinking that regular expressions could be the only answer.
Does anyone have an ideas?
Nick (Webmaster)
info@npfx.com