问题
I working on website that use cleditor (Jquery-Rich Text Editor). The editor have bug - when press enter after letter in firefox created 'br' tag but in IE created 'p' tag.
Bug reproduction: You can see this in their demo http://premiumsoftware.net/cleditor/ (enter some input end press enter (Firefox + IE ) - see different space between lines because in IE generated 'p' tag vs firefox that genarated 'br' tag)
Update:
same question - better explanation then my: http://vanillaforums.org/discussion/13627/ie-uses-paragraph-tags-firefox-uses-br-tags/p1
please help me, what should i change for create 'br' tag also in IE instead 'p' tag.
Thanks, Yosef
回答1:
It is not a bug. CLEditor uses standart browser api which can produce different result in different browsers and you cannot change IE behaviour but you can disable "br" generation in Mozilla by using execCommand
$("#input").cleditor()[0].doc.execCommand("insertBrOnReturn", false, false);
But content should have at least one paragraph. Only in this case firefox will generate "p".
来源:https://stackoverflow.com/questions/4725049/jquery-rich-text-editor-how-can-be-fixed-bug-in-rich-text-editor-when-press