admin管理员组文章数量:1394046
Does anyone know how to fix the problem about Tinymce Line break problem on Safari and Chrome.
For example, Let's say, I have two line pure text. When I copy and paste through firefox or IE. It's under one p tag. So it's same formatting i saw in the text file which is two line.
But if i copy and paste through Chrome or Firefox, it bees two p tag. So at display there,s one space between that two line.
I tried to add safari plugin, but nothing happens. And if i put the plugin called paste_auto_cleanup_on_paste : true, it's removing the space, but two line text became one line.
Cany anyone help me out by providing solution ? I noticed that at wordpress which is using Tinymce Editor also, doesn't occur that problem, because seems like they are using span instead of p at editor. If that's the solution, how can i change to span instead of p. Thanks for your help and greatly appreciated.
Here is when I paste through firefox and IE, firefox produces following code. That's what I want
<p>
This is line 1 <br />
This is line 2 <br />
This is line 3 <br />
</p>
But when I paste through Chrome and Safari, it produced following code. That's what I don't want.
<p> This is line 1 </p>
<p>This is line 2 </p>
<p>This is line 3 </p>
Does anyone know how to fix the problem about Tinymce Line break problem on Safari and Chrome.
For example, Let's say, I have two line pure text. When I copy and paste through firefox or IE. It's under one p tag. So it's same formatting i saw in the text file which is two line.
But if i copy and paste through Chrome or Firefox, it bees two p tag. So at display there,s one space between that two line.
I tried to add safari plugin, but nothing happens. And if i put the plugin called paste_auto_cleanup_on_paste : true, it's removing the space, but two line text became one line.
Cany anyone help me out by providing solution ? I noticed that at wordpress which is using Tinymce Editor also, doesn't occur that problem, because seems like they are using span instead of p at editor. If that's the solution, how can i change to span instead of p. Thanks for your help and greatly appreciated.
Here is when I paste through firefox and IE, firefox produces following code. That's what I want
<p>
This is line 1 <br />
This is line 2 <br />
This is line 3 <br />
</p>
But when I paste through Chrome and Safari, it produced following code. That's what I don't want.
<p> This is line 1 </p>
<p>This is line 2 </p>
<p>This is line 3 </p>
Share
Improve this question
edited Jun 10, 2010 at 11:13
knightrider
asked Jun 10, 2010 at 10:56
knightriderknightrider
2,5837 gold badges30 silver badges42 bronze badges
1
- Did you ever happen to find a solution to this outside of SO? I'm encountering the same thing, and I'm struggling to find a solution. – Matt Sach Commented Aug 3, 2011 at 9:05
3 Answers
Reset to default 3Have you tried to enable the plugin paste
in
tinyMCE.init({
...
plugins : "paste",
...
});
?
As an example, this link is without paste enabled
http://jsbin./obekev and will see Path: p » p
if you try to paste several lines in safari or chrome
and this one has paste enabled http://jsbin./axipof/2 and this time you will see Path: p
: proof that your problem is fixed with paste enabled :)
Hope that helped!
If you take a thorough look at the TinyMCE configuration page there are options to set conversion/removal of <br>
, <p>
etc. In particular I'd play around with:
- http://wiki.moxiecode./index.php/TinyMCE:Configuration/remove_redundant_brs
- http://wiki.moxiecode./index.php/TinyMCE:Configuration/remove_linebreaks
And other options. In my experience with TinyMCE, the difficulty is finding the right permutation of settings that works for you, because they aren't documented well, and certain settings have non-intuitive side effects. But I've always been able to get it to do what I need to do (my goal is always to force-remove <br>s
, keeping clean semantic <p>
s, but each to his own...
I think it is known to be broken in Chrome. If you enable the 'paste' button and click it, TinyMce displays a pop up "Currently not supported by your browser, use keyboard shortcuts instead"
本文标签: javascriptTinymce Line break problem on Safari and ChromeStack Overflow
版权声明:本文标题:javascript - Tinymce Line break problem on Safari and Chrome - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744086461a2588616.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论