Hello,
I have created a custom button on the editor that takes the user's selection and wraps it in some custom tags. It is working acceptably for IE but not for Firefox. There appears to be some extra duplicated tags returned when using the editor.pasteHtml function....or perhaps something left over when calling editor.getSelection.
To reproduce, the user highlights a block of text the end of which contains a link....like below...
They click our custom button which guides them via an external dialog to select a tag ID, in this case 'test1'
The following callback is fired..
with the following values for args
args[0] =
<b>Non Toxic - </b>Western Red Cedar is non toxic, making it safe for all uses. It requires no chemical treatment which is good for you and good for the environment. <a href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm" target="0">Plus wood is the ideal environmentally sound building material.</a>
args[1] =
test1
Upon returning to the page this is what the HTML looks like...
<gwo:script name="test1"></gwo:script><a target="0" href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm"><strong>Non Toxic - </strong>Western Red Cedar is non toxic, making it safe for all uses. It requires no chemical treatment which is good for you and good for the environment. <a target="0" href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm">Plus wood is the ideal environmentally sound building material.</a><gwo:noscript></gwo:noscript></a>
as you can see it wrapped the whole thing in and extra <a> tag. In IE it adds extra <p> and <strong> tags (which I may be able to live with).
For a test, calling editor.pasteHtml(' ') prior to the existing calls to editor.pasteHtml and examining the output of editor.get_html('false'), there exists the offending link <a target="0" href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm">.
Any Idea how I can get rid of those extra tags?
I can make a simple project to forward if necessary.
Thanks!
I have created a custom button on the editor that takes the user's selection and wraps it in some custom tags. It is working acceptably for IE but not for Firefox. There appears to be some extra duplicated tags returned when using the editor.pasteHtml function....or perhaps something left over when calling editor.getSelection.
To reproduce, the user highlights a block of text the end of which contains a link....like below...
Non Toxic - Western Red Cedar is non toxic, making it safe for all uses. It requires no chemical treatment which is good for you and good for the environment. Plus wood is the ideal environmentally sound building material.
They click our custom button which guides them via an external dialog to select a tag ID, in this case 'test1'
The following callback is fired..
var myCallbackFunction = function(sender, args) |
{ |
editor.pasteHtml(String.format("<gwo:script name=\"{0}\">", args[1])); |
editor.pasteHtml(args[0]); |
editor.pasteHtml(String.format("<gwo:noscript>")); |
} |
with the following values for args
args[0] =
<b>Non Toxic - </b>Western Red Cedar is non toxic, making it safe for all uses. It requires no chemical treatment which is good for you and good for the environment. <a href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm" target="0">Plus wood is the ideal environmentally sound building material.</a>
args[1] =
test1
Upon returning to the page this is what the HTML looks like...
<gwo:script name="test1"></gwo:script><a target="0" href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm"><strong>Non Toxic - </strong>Western Red Cedar is non toxic, making it safe for all uses. It requires no chemical treatment which is good for you and good for the environment. <a target="0" href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm">Plus wood is the ideal environmentally sound building material.</a><gwo:noscript></gwo:noscript></a>
as you can see it wrapped the whole thing in and extra <a> tag. In IE it adds extra <p> and <strong> tags (which I may be able to live with).
For a test, calling editor.pasteHtml(' ') prior to the existing calls to editor.pasteHtml and examining the output of editor.get_html('false'), there exists the offending link <a target="0" href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm">.
Any Idea how I can get rid of those extra tags?
I can make a simple project to forward if necessary.
Thanks!