Home Forums General Issues No p tags with wysiwyg field Reply To: No p tags with wysiwyg field

  • Hello. I’ll add my situation on this thread.

    I am consuming data from ACF in a JavaScript front-end application. Because of our product, we have a lot of <sup> going on in a lot of places. I would love to just use a ‘text’ field, but because of this – I have to use WYSIWYG fields for almost everything.

    The prime example, is that we have an H2. It needs to have a WYSIWYG.

    It is used in the template like this:


    Now because the field is a WYSIWYG, that generates something like this:

    <h2><p>Something with a <sup>™</sup></p>/h2>

    And – you can see how that is a problem with my article type system / styling wise (as well as crawler document structure.

    I *could* remove all p tags from the editor… but I also need those in all of the other cases.

    Any ideas – or ways you’ve worked with this?

    An option in the field would be the best – but I can also just teach my team to write sup in the headings / since it’s only a third of them. A WYSISYG that is known to be only one line etc. ?

    If the WYSISYG weren’t so tall by default, that would also be a part of my choices.