Dec 10, 2019 02:50 PM
I have been working on a WordPress site that is pulling information from Airtables.
Using simple jQuery i am inserting the content of a Long Text into a span tag
$(".descBio").append(record.fields[“Biography Content”]);
The issue is the line breaks in the long text are not interpreted. I am working around this by adding
tags in the Long Text but that is a bad solution.
What do I need to do? Thanks!
Jon
Dec 10, 2019 03:20 PM
And you are certain there are line breaks in the long text strings? If so, you should be able to simply replace them with HTML line breaks.
$(".descBio").append(record.fields[“Biography Content”].toString().replace(/\n/ig, "</br>"));
FWIW, the line breaks indeed are not being interpreted because browsers can’t see them.
Dec 11, 2019 06:02 AM
Thanks for the tip Bill!