trumbowyg

Div automatically converts into <p> tag in the Trumbowyg editor


Consider:

Enter image description here

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?


Solution

  • 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'}}