Types
TipTapSchema = object whitelist*: set[TipTapNodeType] = {ttParagraph..ttHighlight} ## A set of allowed node types in the TipTap content layoutRules*: seq[TipTapNodeType] ## A sequence defining allowed layout rules for nodes. ## ## If empty, no layout rules are enforced, otherwise nodes must ## follow the specified order. ## ## (e.g., [ttHeading, ttParagraph, ttImage])
- Defines the schema for validating TipTap content. It includes a whitelist of allowed node types and optional layout rules for node ordering.
Consts
defaultTipTapSchema = (whitelist: {ttParagraph..ttHighlight}, layoutRules: [])
Procs
proc validate(content: TipTapContent; schema: TipTapSchema = defaultTipTapSchema): bool {. ...raises: [], tags: [], forbids: [].}
-
Validates the TipTap content structure using the provided JSON schema.
If no schema is provided, it uses the default schema.