admin管理员组文章数量:1425919
I have an tinyMCE and I have to set the option "force_br_newlines: true", because when I don't do it, and I'm pushing "Enter" for example two times and look in the source-code, there is only one <br>
.
But when I set the option on TRUE, I have a problem with my unsorted list. When the loaded text es from my databse to the tinyMCE, it makes out of
<ul><li> MY TEXT </li><li> MY TEXT 2 </li><ul>
this-->
<ul><br /><li> MY TEXT </li><br /><li> MY TEXT 2 </li><br /><ul>
Is there a possibility to prevent this??? I dont want to have the <br />
in it!
THANK YOU VERY MUCH FOR YOUR HELP!!!!!
I have an tinyMCE and I have to set the option "force_br_newlines: true", because when I don't do it, and I'm pushing "Enter" for example two times and look in the source-code, there is only one <br>
.
But when I set the option on TRUE, I have a problem with my unsorted list. When the loaded text es from my databse to the tinyMCE, it makes out of
<ul><li> MY TEXT </li><li> MY TEXT 2 </li><ul>
this-->
<ul><br /><li> MY TEXT </li><br /><li> MY TEXT 2 </li><br /><ul>
Is there a possibility to prevent this??? I dont want to have the <br />
in it!
THANK YOU VERY MUCH FOR YOUR HELP!!!!!
3 Answers
Reset to default 1BR elements should only be used when you really have to (mostly never). Also as of 3.x the forced_root_block option is enabled by default so if you really want to disable paragraphs disable that one as well.
So add
tinyMCE.init({
...
force_br_newlines : true,
force_p_newlines : false,
forced_root_block : '' // Needed for 3.x
});
BTW TinyMCE's official page suggests not to use BR elements for linebreaks.
Add
tinyMCE.init {
...
...
apply_source_formatting : false
}
Did you include 'lists' in plugins settings?
tinymce.init({
plugins: "lists link stylebuttons", // For example
// ...
});
本文标签: javascriptTinyMCE How to prevent ltbrgtTAG in listelementStack Overflow
版权声明:本文标题:javascript - TinyMCE: How to prevent <br>-TAG in list-element - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745384023a2656297.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论