Long Text Output in HTML

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!

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.

Thanks for the tip Bill!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.