{"record":{"id":"55ae6878b8fe70f3","repo":"toeverything/AFFiNE","slug":"failed-to-parse-or-decode-footnote-definition","errorCode":null,"errorMessage":"Failed to parse or decode footnote definition:","messagePattern":"Failed to parse or decode footnote definition:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"blocksuite/affine/blocks/bookmark/src/adapters/markdown/markdown.ts","lineNumber":63,"sourceCode":"        }\n        let footnoteDefinitionJson;\n        try {\n          footnoteDefinitionJson = FootNoteReferenceParamsSchema.parse(\n            JSON.parse(footnoteDefinition)\n          );\n          // If the footnote definition contains url, decode it\n          if (footnoteDefinitionJson.url) {\n            footnoteDefinitionJson.url = decodeURIComponent(\n              footnoteDefinitionJson.url\n            );\n          }\n          if (footnoteDefinitionJson.favicon) {\n            footnoteDefinitionJson.favicon = decodeURIComponent(\n              footnoteDefinitionJson.favicon\n            );\n          }\n        } catch (err) {\n          console.warn('Failed to parse or decode footnote definition:', err);\n          return;\n        }\n\n        const { url, favicon, title, description } = footnoteDefinitionJson;\n        walkerContext\n          .openNode(\n            {\n              type: 'block',\n              id: nanoid(),\n              flavour: BookmarkBlockSchema.model.flavour,\n              props: {\n                url,\n                footnoteIdentifier,\n                icon: favicon,\n                title,\n                description,\n                style: 'citation',\n              },","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/blocksuite/affine/blocks/bookmark/src/adapters/markdown/markdown.ts#L45-L81","documentation":"Warning logged in the bookmark markdown adapter when the footnote definition for a bookmark reference cannot be processed — either JSON.parse fails on the definition string or FootNoteReferenceParamsSchema validation fails, or the subsequent URL decodeURIComponent throws on malformed encoding. The bookmark is skipped and the rest of the document is converted normally.","triggerScenarios":"Triggered when the bookmark markdown adapter fails to JSON-parse the footnote definition or to decodeURIComponent its url/favicon fields during markdown import.","commonSituations":"Occurs when pasting or importing markdown whose bookmark footnote JSON is malformed or contains invalid percent-encoding. The bookmark is skipped; fix the footnote payload.","solutions":["Fix the footnote definition encoding in the source.","Remove the malformed footnote."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}