Tinymce paste problem in google chrome
I am using following javascript code to convert double <br>
into paragraph.
paste_preprocess : function(pl, o) {
o.content = o.content.replace(/\<br\>\<br\>/gi, '</p><p>');
o.content = '<p>'+o.content+'</p>';
},
This code works fine for firefox when I copy text from notepad and paste it but in Google chrome it adds <p> </p>
on top and bottom and instead of <p>
i see one <pre>
tag and double <br>
here is the sample output
<p> </p>
<pre>http://www.google.com/support<br /><br />visit Google.com for more information</pre>
<p> </p>
开发者_StackOverflow社区The above JavaScript code supposed to add paragraph tag not <pre>
Wondering why its not working for Chrome?
I made an example of this here:
http://jsfiddle.net/MH6kw/2/
..and it seems to work flawlessly.
You have to inspect element on the lower right box to see the results, but I also wrote instructions on there.
I am fairly certain the "content" attribute is only supposed to be used by meta tags, and the obj.content property is only supposed to be used to access meta tags.
What element are you using this on?
精彩评论