{"record":{"id":"36ca7790b9554ecb","repo":"ueberdosis/tiptap","slug":"failed-to-parse-html-in-markdown-error","errorCode":null,"errorMessage":"Failed to parse HTML in markdown: ${error}","messagePattern":"Failed to parse HTML in markdown: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/markdown/src/MarkdownManager.ts","lineNumber":983,"sourceCode":"    // Use generateJSON to parse the HTML using extensions' parseHTML rules\n    try {\n      const parsed = generateJSON(html, this.baseExtensions)\n\n      // If the result is a doc node, extract its content\n      if (parsed.type === 'doc' && parsed.content) {\n        // For block-level HTML, return the content array\n        if (token.block) {\n          return parsed.content\n        }\n\n        const inlineContent = this.toInlineContent(parsed.content)\n\n        return inlineContent.length > 0 ? inlineContent : null\n      }\n\n      return parsed as JSONContent\n    } catch (error) {\n      throw new Error(`Failed to parse HTML in markdown: ${error}`)\n    }\n  }\n\n  /**\n   * Keep only the inline nodes of parsed HTML content, unwrapping the block\n   * nodes around them. Inline HTML sits inside a textblock, where a block node\n   * would make the document invalid for the schema.\n   *\n   * @param content Content array of a parsed HTML fragment.\n   * @example\n   *   toInlineContent([{ type: 'paragraph', content: [{ type: 'text', text: 'hi' }] }])\n   *   // → [{ type: 'text', text: 'hi' }]\n   */\n  private toInlineContent(content: JSONContent[]): JSONContent[] {\n    const inlineTypes = this.getInlineNodeTypes()\n\n    return content.flatMap(node => {\n      if (node.type && inlineTypes.has(node.type)) {","sourceCodeStart":965,"sourceCodeEnd":1001,"githubUrl":"https://github.com/ueberdosis/tiptap/blob/496d53afd7e4e3c7424b4749adeff4f45e27ddb0/packages/markdown/src/MarkdownManager.ts#L965-L1001","documentation":"Error \"Failed to parse HTML in markdown: ${error}\" thrown in ueberdosis/tiptap.","triggerScenarios":"Thrown at packages/markdown/src/MarkdownManager.ts:983 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"496d53afd7e4e3c7424b4749adeff4f45e27ddb0","analyzedAt":"2026-08-26T22:41:43.400Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}