开发者

Strip HTML style attributes in dijit.Editor (onPaste)

Is there anyway to make the dijit.Editor strip HTML style="" attributes from pasted content?

If I copy text from another site, it copies it's f开发者_如何学Goont-size, color, etc and puts it into span tags. I would prefer to only strip styles when pasting.

I already have a tried-and-tested regex to replace the content, but I don't know how to hook it up with the dijit.Editor. I tried pushing a function to contentPreFilters but that doesn't get called when pasting text.


Try the dojox.editor.plugins.NormalizeStyle Plugin by Jared Jurkiewicz. It allows for configuring either CSS style or normal attributes output.


htmlEditor.editNode.innerText

does the trick for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜