rich text editor - javascript: Google Closure - RichTextEditor plugin -


i making custom plugin rich texteditor sets span class selected text, like: <span class="myclass">text</span>

ok, pretend have following text:

this test. 

now after selecting test , clicking button trigger plugin output:

this <span class="myclass">test</span>. 

now after select whole text , click button again, output:

<span class="myclass">this <span class="myclass">test</span>.</span> 

any idea how fix this?

you use rangy library , class applier module.

var applier = rangy.createcssclassapplier("myclass"); applier.applytoselection(); 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -