Code
Preformatted code with an optional language.
Preformatted code with an optional language.
Code block
<meta name="robots" content="noindex">The block
As the API returns it, from the example article:
{ "type": "code", "language": "html", "code": "<meta name=\"robots\" content=\"noindex\">", "id": "code-13"}Replace it
Pass your own component for the type. It receives the block, typed, and every other type keeps its default. The default stays available, so you can wrap it instead of starting over:
import { Article, defaultComponents } from "@/components/seoforsaas/article";import type { CodeBlock } from "@/lib/seoforsaas/types";const DefaultCode = defaultComponents.code;function MyCode({ block }: { block: CodeBlock }) { return ( <div className="my-code"> <DefaultCode block={block} /> </div> );}<Article blocks={article.blocks} components={{ code: MyCode }} />Notes
Render
codeas text. To highlight it, pass your own component (for example, one using shiki) throughcomponents.code.