Hi all!
I want to make a plugin that wraps the selected text. It has to preserve all html in the selected text.
This is my current solution:
But that erases every html element in the selected text, so if I would select "ab <strong>cd</strong> ef" the wrapped text would become "ab cd ef"
Please help! I have been googling and browsing objects in firebug for days now, with no result..
// Markus
I want to make a plugin that wraps the selected text. It has to preserve all html in the selected text.
This is my current solution:
FCK.InsertHtml('<a href="' + href + '">' + FCK.EditorDocument.getSelection() + '</a>');
But that erases every html element in the selected text, so if I would select "ab <strong>cd</strong> ef" the wrapped text would become "ab cd ef"
Please help! I have been googling and browsing objects in firebug for days now, with no result..
// Markus
Re: Wrap selected text, keep HTML
We'd also like to include html code within wiki articles, not just url and internal article links.
On a related note, we'd like to be able to include links (both internal to other wiki articles and external urls) within image captions, but FCK 2 seems to strip-out the link within the image wiki-tag.
for example, would like to use:
[[Image:Exxon valdez aground.jpg|left|250px|thumb|The ''Exxon Valdez'' aground on Bligh Reef, [[Prince William Sound, Alaska| Prince William Sound]] Photo: NOAA]]
but, instead fck strips-out, with result:
[[Image:Exxon valdez aground.jpg|thumb|left|250px|The Exxon Valdez aground on Bligh Reef, Prince William Sound Photo: NOAA]]
Any one know how to get around this?
Would "fck_insertHtmlCode" ([ 1658125 ] Add HTML Code for 2.4) at: http://sourceforge.net/tracker/index.ph ... tid=737639 do the trick?
(Found that plugin at SourceForge, list of FCKeditor 2.x plugins.)
Thanks, Matthew.