SOLVED: Meta Box WYSIWYG Editor field is added with additional unwanted <p>

Hey Dan,
The problem is this one SOLVED: Basic text element adds 2 extra paragraph.

We’ve just re-uploaded 1.7 beta containing the fix mentioned above, so you can test it again (see the screenshot from my test): Bricks – Account

This is probably what Andre has already described above. If you use <p> as a wrapper, the <p> is opened and automatically closed by the browser with the next <p>.

Quote from the specs:

Paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the closing </p> tag. See “Tag omission” below.

Long story short: From our point of view, there are three cases in which the Basic Text Element should output tags:

  1. you write them in manually:
    <p>This is <span class="test">my custom HTML</span> text.</p>

  2. The source is a WYSIWYG dynamic data field.

  3. The source is a dynamic data field that provides you with a UI setting to add formatting (such as ACF does for the textarea)

Best regards,
timmse

1 Like