Content That Respects Your Design System

Freeform rich text is where design systems go to die. Give a CMS unrestricted HTML and eventually someone pastes in an inline style attribute that breaks your dark mode, or a class name that doesn't exist in your CSS. Carapace avoids the problem by never allowing it in the first place.

An explicit vocabulary

Every post is checked against a small, explicit list of allowed tags, attributes, and — critically — class values. There's no open-ended custom class. A blockquote can only be styled as one of four callout variants:

This is what a callout-success looks like when it renders.
And this is callout-danger — reserved for the things readers really shouldn't skip.

Syntax highlighting, the same way

Code blocks work the same way: a language class from a fixed list, nothing invented on the fly.

def render(post):
    assert post.html in allowed_vocabulary
    return sanitize(post.html)

The upside isn't just security — it's consistency. Every post, whoever or whatever wrote it, ends up looking like it belongs on the same site.