toeverything/AFFiNE · error

Failed to parse linked doc footnote definition:

Error message

Failed to parse linked doc footnote definition:

What it means

Warning logged in the embed-linked-doc markdown adapter when parsing the footnote definition for a linked-doc citation fails (invalid JSON or schema mismatch). The linked-doc block is not created from that footnote; the adapter skips it and continues converting the remaining content.

Source

Thrown at blocksuite/affine/blocks/embed-doc/src/embed-linked-doc-block/adapters/markdown.ts:75

          walkerContext
            .openNode(
              {
                type: 'block',
                id: nanoid(),
                flavour: EmbedLinkedDocBlockSchema.model.flavour,
                props: {
                  pageId: docId,
                  footnoteIdentifier,
                  style: 'citation',
                },
                children: [],
              },
              'children'
            )
            .closeNode();
          walkerContext.skipAllChildren();
        } catch (err) {
          console.warn('Failed to parse linked doc footnote definition:', err);
          return;
        }
      },
    },
    fromBlockSnapshot: {
      enter: (o, context) => {
        const { configs, walkerContext } = context;
        // Parse as link
        if (!o.node.props.pageId) {
          return;
        }
        const title = configs.get('title:' + o.node.props.pageId) ?? 'untitled';
        const url = AdapterTextUtils.generateDocUrl(
          configs.get('docLinkBaseUrl') ?? '',
          String(o.node.props.pageId),
          o.node.props.params ?? Object.create(null)
        );
        walkerContext

View on GitHub (pinned to b4c8548c09)

Solutions

  1. Fix the linked-doc footnote syntax.
  2. Re-export the markdown with valid footnotes.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Triggered when the embed-linked-doc markdown adapter cannot parse the footnote definition of a linked-doc node during markdown import, so the linked doc reference is skipped.

Common situations: Occurs when importing markdown containing a malformed linked-doc footnote. The linked doc embed is dropped; ensure the footnote definition is well-formed JSON.

Understand the failure class


AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18). Data as JSON: /api/errors/f5449e7eeb8db1df. Report an issue: GitHub.