Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to give new line spaces in sanity portableText content?

i tried to add new lines in sanity studio but didn’t get new line in between contents in portable text library, i rendered into my Next js 14 project

async function page({params}:{params: { slug: string }}) {
    const data = await getBlog(params.slug);
    return (
        <div>
            <PortableText value={data?.content} />
        </div>
    )
}

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I had similar kind of problem in one of my recent Project in NextJs 14 and sanitystudio and found the solution for this I think it may be help to my fellow developers

Solution – shift+Enter

It gives a new line in sanity content

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading