Why Portable Text is awesome and you totally want it in your CMS
Written by Knut Melvær
Let us get this out of the way first: We love HTML. We love Markdown. We use both every day for writing on the web. Even this text began its life in Markdown. And with this rather uncontroversial opening, you can probably see what's coming. We'll argue why you don't want Markdown or HTML stored in your CMS (except as code examples).
Almost everyone does it though, even the new kids on the block. We went through all the vendors on headlesscms.org and browsed through the documentation, and also signed up for those who didn't mention it: with two exceptions they all stored rich text either as HTML or Markdown. Fine if all you do is use Jekyll to render a website, or if you enjoy using dangerouslySetInnerHTML in React.
But if you want to reuse your content in interfaces that aren't on the web. Or if you want more control and functionality in your rich text editor. Or you just want it to be easier to render your rich text in one of the popular frontend frameworks and have your components take care of different parts of your rich text content — you'll either have to find a smart way to parse that Markdown or HTML into what you need, or, more conveniently, just have it stored more sensibly in the first place.
This is why Sanity adopted and developed the Portable Text model for how we store rich text. And now other CMS vendors have started experimenting with it. We're glad it's catching on. Text that is portable is good for everyone.
What does Portable Text actually look like?
Let's get down to business. How does "That was bold of you. Amazing, actually" look in Portable Text?
Internal server error