Skip to content

fix(html): handle declaration-only documents without TypeError#4412

Open
santhreal wants to merge 1 commit into
Unstructured-IO:mainfrom
santhreal:fix/html-none-root-typeerror
Open

fix(html): handle declaration-only documents without TypeError#4412
santhreal wants to merge 1 commit into
Unstructured-IO:mainfrom
santhreal:fix/html-none-root-typeerror

Conversation

@santhreal

@santhreal santhreal commented Jul 18, 2026

Copy link
Copy Markdown

lxml HTMLParser returns None for declaration-only input such as or , and strip_elements then TypeErrors. Re-parse a minimal so partition_html returns [].

Review in cubic

lxml HTMLParser returns None for inputs like <?xml ...?> and
<!DOCTYPE html>, and strip_elements then raised TypeError. Treat a
None root as an empty html document so partition_html/partition_md
degrade to [].

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Shadow auto-approve: would auto-approve. Fixes a clear crash for declaration-only HTML by inserting a minimal fallback root. The change is bounded and purely a bug fix.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant