ueberdosis/tiptap · error · Error

Failed to parse HTML in markdown: ${error}

Error message

Failed to parse HTML in markdown: ${error}

What it means

Error "Failed to parse HTML in markdown: ${error}" thrown in ueberdosis/tiptap.

Source

Thrown at packages/markdown/src/MarkdownManager.ts:983

    // Use generateJSON to parse the HTML using extensions' parseHTML rules
    try {
      const parsed = generateJSON(html, this.baseExtensions)

      // If the result is a doc node, extract its content
      if (parsed.type === 'doc' && parsed.content) {
        // For block-level HTML, return the content array
        if (token.block) {
          return parsed.content
        }

        const inlineContent = this.toInlineContent(parsed.content)

        return inlineContent.length > 0 ? inlineContent : null
      }

      return parsed as JSONContent
    } catch (error) {
      throw new Error(`Failed to parse HTML in markdown: ${error}`)
    }
  }

  /**
   * Keep only the inline nodes of parsed HTML content, unwrapping the block
   * nodes around them. Inline HTML sits inside a textblock, where a block node
   * would make the document invalid for the schema.
   *
   * @param content Content array of a parsed HTML fragment.
   * @example
   *   toInlineContent([{ type: 'paragraph', content: [{ type: 'text', text: 'hi' }] }])
   *   // → [{ type: 'text', text: 'hi' }]
   */
  private toInlineContent(content: JSONContent[]): JSONContent[] {
    const inlineTypes = this.getInlineNodeTypes()

    return content.flatMap(node => {
      if (node.type && inlineTypes.has(node.type)) {

View on GitHub (pinned to 496d53afd7)

When it happens

Trigger: Thrown at packages/markdown/src/MarkdownManager.ts:983 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of ueberdosis/tiptap@496d53afd7 (2026-08-26). Data as JSON: /api/errors/36ca7790b9554ecb. Report an issue: GitHub.