• Resolved Kjetil

    (@kjetilgf)


    Separate paragraphs are output as a single line of text, even if I add them to a wysiwyg field with hard line breaks.

    I have tried the tip in this thread, checking wysiwyg editor field > Options > Enable wpautop without luck.
    (In the thread also to “wrap the variable with wpautop()” is mentioned, but I have no idea how)

    Ideas, please?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Kjetil

    (@kjetilgf)

    PS
    The oddest part is that it works in one out of two identical fields (even with almost the same contents): I duplicated one wysiwyg field that worked, but the copy just won’t work.
    See screenshots – frontend/backend

    Plugin Support pdclark

    (@pdclark)

    Preserving line breaks would depend on:

    • Field Settings: In addition to wpautop being enabled, are p and br in the allowed HTML output tags for the field?
    • Output context: How and where is the field being output in the frontend theme? Does switching to a default theme or changing the context or display method resolve it? Sometimes themes or widgets can remove HTML from output.
    • Is any HTML output in the frontend when testing? Raw HTML can be viewed in the browser web inspector, or right click > inspect element. One would expect to see <p> tags for returns and <br/> tags for shift-returns.
    • If the HTML is correct, but display is not as expected, is there any theme CSS applied to the elements which might change expected display — such as displaying paragraph tags as inline-block instead of block, flex display, floats, etc? This can also be tested by switching to a default theme or trying a different display context.
    Thread Starter Kjetil

    (@kjetilgf)

    Thank you for coming back to me.
    Solved.
    I started out writing you a thorough reply, but after once more connecting the relevant custom field to the front end (a Powerpack BB module), the text displays correctly, with paragraphs.
    I suspected that one of the field options had screwed things up, but after toggling them on and off in different combinations, I still can’t figure out what caused the hickup.

    Trim whitespace at the end of lines
    Remove blank lines including empty “p” tags and “br” tags
    Remove extra blank lines

    FYI – I checked that
    1 – html and wpautop are allowed
    2 – Output context: The field content is displayed via a BB Powerpack module > “+” > Pods field: Post, page, term” (not a post custom field – important) > Connect > correct Pods field slug.
    3 – No html wa utput on the frontend
    4 – Can’t say now, but absolutely a thing to keep in mind.

    Thanks again for your checklist!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Lione breaks are removed’ is closed to new replies.