Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Open
santhreal wants to merge 1 commit into
Unstructured-IO:mainUnstructured-IO/unstructured:mainfrom
santhreal:fix/html-none-root-typeerrorsanthreal/unstructured:fix/html-none-root-typeerrorCopy head branch name to clipboard
Open

fix(html): handle declaration-only documents without TypeError#4412
santhreal wants to merge 1 commit into
Unstructured-IO:mainUnstructured-IO/unstructured:mainfrom
santhreal:fix/html-none-root-typeerrorsanthreal/unstructured:fix/html-none-root-typeerrorCopy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.