Opened 12 years ago

Closed 12 years ago

#3597 closed defect (fixed)

replaceEditorContent doesn't replace tags

Reported by: guest Owned by: liucougar
Priority: high Milestone: 0.9
Component: Editor Version: 0.4.2
Keywords: Cc: welldamn@…
Blocked By: Blocking:

Description

When pasting any rich text -- say from word, google, wherever, and attempting to replace the content of the editor by calling replaceEditorContent, I'm noticing that the editor still maintains any outter tags.

For example, if I paste in this text:

 <h1><a href="#">this <b>is</b> a test</a></h1>

And try to replace the text with:

<b>test</b>

The editor results in

<h1><a href="#"><b>test</b></a></h1>

Looking at the code for this function, it seems pretty hacky, as it simply selects the text and does a replace on the text using the execCommand behaviors.

Problem is it's only starting the selection from the first 'real' character -- not tag. so any 'wrapping' tags remain.

Change History (1)

comment:1 Changed 12 years ago by liucougar

Resolution: fixed
Status: newclosed

replaceValue is the new function for dijit, it should have fixed this issue

Note: See TracTickets for help on using tickets.