Div在Trumbowyg编辑器中会自动转换为<p>标签。

huangapple go评论93阅读模式
英文:

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:

Div在Trumbowyg编辑器中会自动转换为<p>标签。

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 &lt;div&gt; tags are automatically converted into &lt;p&gt; 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文件中,请从上述代码中删除&#39;div&#39;: &#39;p&#39;这个属性。)

尝试在您的JavaScript文件中找到此关键字:**&quot;DEFAULT_SEMANTIC_MAP&quot;**。

在删除它之后,代码将如下所示:

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: { &#39;b&#39;: &#39;strong&#39;, &#39;i&#39;: &#39;em&#39;, &#39;s&#39;: &#39;del&#39;, &#39;strike&#39;: &#39;del&#39;, &#39;div&#39;: &#39;p&#39; }}

('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: { &#39;b&#39;: &#39;strong&#39;, &#39;i&#39;: &#39;em&#39;, &#39;s&#39;: &#39;del&#39;, &#39;strike&#39;: &#39;del&#39;}}

huangapple
  • 本文由 发表于 2023年2月27日 16:59:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/75578458.html
  • trumbowyg
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定