@umbraco-cms/backoffice
    Preparing search index...

    Function createBlockMarkdownSpec

    • Creates a complete markdown spec for block-level nodes using Pandoc syntax.

      The generated spec handles:

      • Parsing blocks with :::blockName {attributes} syntax
      • Extracting and parsing attributes
      • Rendering blocks back to markdown with proper formatting
      • Nested content support

      Parameters

      Returns {
          markdownTokenizer: MarkdownTokenizer;
          parseMarkdown: (
              token: MarkdownToken,
              h: MarkdownParseHelpers,
          ) => MarkdownParseResult;
          renderMarkdown: (node: JSONContent, h: MarkdownRendererHelpers) => string;
      }

      Complete markdown specification object

      const calloutSpec = createBlockMarkdownSpec({
      nodeName: 'callout',
      defaultAttributes: { type: 'info' },
      allowedAttributes: ['type', 'title'] // Only these get rendered to markdown
      })

      // Usage in extension:
      export const Callout = Node.create({
      // ... other config
      markdown: calloutSpec
      })