英文:
Div automatically converts into <p> tag in the Trumbowyg editor
问题
I'm using the Trumbowyg HTML editor. In this editor, I've entered some HTML content in the code section, but after adding the HTML, the <div>
tags are automatically converted into <p>
tags. How can I prevent/disable this behavior?
英文:
Consider:
I'm using the Trumbowyg HTML editor. In this editor, I've entered some HTML content in the code section, but after adding the HTML, the <div>
tags are automatically converted into <p>
tags.
How can I prevent/disable this behavior?
答案1
得分: 1
我尝试使用[文本编辑器][1],遇到了相同的问题;我试图通过使用以下代码来修复它:
Trumbowyg.prototype = { DEFAULT_SEMANTIC_MAP: { 'b': 'strong', 'i': 'em', 's': 'del', 'strike': 'del', 'div': 'p' }}
(在您的.js文件中,请从上述代码中删除'div': 'p'这个属性。)
尝试在您的JavaScript文件中找到此关键字:**"DEFAULT_SEMANTIC_MAP"**。
在删除它之后,代码将如下所示:
Trumbowyg.prototype = { DEFAULT_SEMANTIC_MAP: { 'b': 'strong', 'i': 'em', 's': 'del', 'strike': 'del'}}
[1]: https://help.ubuntu.com/community/gedit
英文:
I tried using Text Editor and had the same problem; I attempted to fix it by using the following code:
Trumbowyg.prototype = { DEFAULT_SEMANTIC_MAP: { 'b': 'strong', 'i': 'em', 's': 'del', 'strike': 'del', 'div': 'p' }}
('div': 'p' remove this attribute from above code inside your .js file.)
Try to find this keyword in your JavaScript file: "DEFAULT_SEMANTIC_MAP".
After removing it, the code will look like this:
Trumbowyg.prototype = { DEFAULT_SEMANTIC_MAP: { 'b': 'strong', 'i': 'em', 's': 'del', 'strike': 'del'}}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论