[kupu-dev] kupu error when I try to insert some custom code
Jordi Martinez
jordim at guellconsulting.com
Wed Oct 29 08:47:34 CET 2008
Guido Wesdorp escribió:
> Jordi Martinez wrote:
>> var tnode =
>> this.editor.getInnerDocument().createTextNode(texte);
>> sel.replaceWithNode(tnode, true);
> I have the feeling replaceWithNode doesn't work well with text
> nodes... I wanted to try this out properly before responding,
> unfortunately I don't seem to find the time to do so, so no promises,
> just a guess... :|
>
> You may want to try a work-around like this:
>
> var doc = this.editor.getInnerDocument();
> var tempnode = doc.createElement('span');
> var tnode = doc.createTextNode(texte);
> sel.replaceWithNode(tempnode, true);
> tempnode.parentNode.replaceChild(tempnode, tnode);
> sel.selectNodeContents(tnode);
>
> Again, not sure if it works, but may be worth a try...
>
> Cheers,
>
> Guido
>
Ok, Guido!
Only having a way to try I feel more quiet
I will try this alternatives today and I will send some response to the list
Thanks again
More information about the kupu-dev
mailing list