• Resolved cbruno33

    (@cbruno33)


    Hello ~

    I’m trying to figure out how to get line breaks in text (represented as “\n”) to be handled in the output. For example, the json contains value “description”:”Text line one. \n Text line two.”

    The shortcode displays the description output as:
    Text line one. Text line two.

    When it should be displayed as:
    Text line one.
    Text line two.

    How can I get \n to be recognized as a line break in the output?

    Thanks.

    https://www.ads-software.com/plugins/json-content-importer/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author berkux

    (@berkux)

    Hi,

    if “\n” is in the JSON, the HTML would be “
    “.
    This kind of replacement is not in the plugin yet.
    I’ll have to think about that…

    Bernhard

    Thread Starter cbruno33

    (@cbruno33)

    HI Bernhard,

    Thanks, the JSON is generated from an app that allows users to enter text with line breaks, which I guess comes through as “\n” in the JSON.

    I’d be happy to donate again if you’re able to address this issue and the other topic I posted regarding “display on specific sub-loop item”, which is actually more important.

    Thanks again,
    Bruno

    Plugin Author berkux

    (@berkux)

    New in Version 1.2.1:
    “{street:htmlAndLinefeed2htmlLinefeed}”: Same as “{street:html}” plus “\n”-Linefeeds are converted to HTML-Linebreak “

    Thread Starter cbruno33

    (@cbruno33)

    Awesome!!! Thanks so much for this fix — it’s working perfectly and makes this extension even more useful. I really appreciate the work.

    As soon as you’ve have time to incorporate the other feature (targeting specific items in sub-loops) let me know and I’ll happily donate again.

    Take care,
    Bruno

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Displaying line breaks in text’ is closed to new replies.