koenig/kg-default-nodes/README.md
Lexical node definitions for all of Ghost's cards, including each node's HTML renderer. This is the single source of truth for node rendering — both the editor and the server render through it.
npm install @tryghost/kg-default-nodes
const {createEditor} = require('lexical');
const {DEFAULT_NODES, DEFAULT_CONFIG} = require('@tryghost/kg-default-nodes');
const editor = createEditor({
nodes: DEFAULT_NODES,
html: DEFAULT_CONFIG.html
});
DEFAULT_NODES covers Ghost's own cards, so pair it with the base Lexical
nodes your content needs. DEFAULT_CONFIG.html supplies the import serializers
that keep pasted HTML mapping onto the right nodes.
Individual nodes are exported by name (ImageNode, CalloutNode, and so on)
when you need a subset rather than the full set.
This package must stay browser-safe: it runs inside the editor as well as on the server.
This package is part of the Ghost monorepo
and resolves through the pnpm workspace — there is no linking or per-package
install step. Run pnpm setup in the monorepo root, then work in
koenig/kg-default-nodes.
See the Koenig README for the shared build, test and release workflow.
pnpm test:unit runs the unit testspnpm test runs the unit and type tests, including coverage thresholdspnpm lint runs the lint checksCopyright (c) 2013-2026 Ghost Foundation - Released under the MIT license.