However, rendering both in the UI seems to be an issue. I can render the preformatted html using
const createCopyMarkup = () => {
return { __html: DOMPurify.sanitize(prismicH.asText(data.body)) };
};
And I can get render the formatted rich text using
PrismicRichText field={data.body}
However getting both to render properly from a single field in Prismic doesn't seem to be possible or I'm missing something? We really would like our editors to have only one field to work from and be able to add formatted and preformatted content. Is this possible or do these need to be two separate fields?
If I understood correctly, you need to handle preformatted and formated HTML differently, and as you know, Prismic writing room (UI) allows to select either preformatted or normal text such as:
This partially works, if the preformatted and other rich content are in separate sections. However, in our use case we need to have a way to either commingle preformatted and non preformatted in the same paragraph. Or Prismic's editor needs to support all html tags.
Example of commingling (Our current site): Links to the footnotes as an example https://www.everlylife.com/blog/universal-life-insurance-vs-whole-life-insurance
Attempting to solve this with Prismic content: Everly Life - Life Insurance Made for Living