sanitynextjs14

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

  • 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