Help

Long Text Output in HTML

1328 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Jon_Eynon
6 - Interface Innovator
6 - Interface Innovator

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

2 Replies 2

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!