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)
);
walkerContextView on GitHub (pinned to b4c8548c09)
Solutions
- Fix the linked-doc footnote syntax.
- 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
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18).
Data as JSON: /api/errors/f5449e7eeb8db1df.
Report an issue: GitHub.