Line breaks in rich text fields

hi guys, line breaks that we enter within a rich text box are not pulling through to our site…

Hi Savio,

Welcome to Prismic community, I will try to help you on this.

Did you try hitting shift/cmd+enter in the prismic editor? If you are a developer on this project you might also need to update “prismic-dom” library to the latest version.

Here a discussion related to this.

Also make sure that you use asHtml method in your codebase such as

PrismicDOM.RichText.asHtml(content.home.data.description)

as if you use asText you lose the formatting.

Please let us know if that doesn’t solve the issue for you,

Fares

thanks Fares. i tried shift enter, did not work, i am checking with my dev team on the prismic-dom input.

1 Like

I’m one of the developers. We are using latest prismic.io .net nuget package to achieve this.
We are already taking the text as html. Following is sample of how we do it:
document.GetStructuredText(section).AsHtml(DocumentLinkResolver.For((doc) => “/test-path/”)) ;

1 Like

Closed due to inactivity.