Skip to content

Add support for HTML lists, improve handling of HTML special entities#134

Open
okriuchykhin wants to merge 1 commit into
sandrods:masterfrom
okriuchykhin:html_lists_support
Open

Add support for HTML lists, improve handling of HTML special entities#134
okriuchykhin wants to merge 1 commit into
sandrods:masterfrom
okriuchykhin:html_lists_support

Conversation

@okriuchykhin

@okriuchykhin okriuchykhin commented Jun 16, 2026

Copy link
Copy Markdown

Support HTML lists in add_text; fix invalid content.xml from HTML input

Converts <ul>/<ol>/<li> (including nested) to ODF text:list, and fixes a bug where foreign tags (<a>, <b>, <span>) and HTML entities (&nbsp;) were passed through verbatim, producing invalid ODF that LibreOffice rejects with a "Format error".

The HTML-to-ODF conversion now walks nodes instead of regex: known tags map to ODF spans/line-breaks, any other tag is unwrapped (text kept), and text is taken decoded so no undefined entity reaches content.xml.

Includes tests for list structure and inline safety (asserting only ODF elements end up under office:text).

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