I'm upgrading a Next.js project to use @prismicio/react V2, from an older version using prismic-reactjs, and preserving all of the front-end as much as possible.
One of the I have a RichText component that is outputting preformatted code examples, using an html serializer according to the V2 docs. When applying highlight.js, all of the line breaks disappear, where there were previously honored before.
The CSS is 100% the same... the only difference that I can tell, is that when you view source, the line breaks (\n
) from the content source are actually turned into <br>
tags in the old version. In the new version, that is not the case, and only whitespace from those line breaks is rendered. I'm not sure if this is a Next issue (maybe SSR?) or a Prismic serialize issue...
Any pointers would be helpful.