Skip to content

fix(editor): convert only the html code block when updating a table - #62

Open
RaphaelFakhri wants to merge 1 commit into
docling-project:mainfrom
RaphaelFakhri:fix/html-table-code-block
Open

RaphaelFakhri wants to merge 1 commit into
docling-project:mainfrom
RaphaelFakhri:fix/html-table-code-block

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

convert_html_to_docling_table extracts the ```html code block from the model reply, but then converts the full reply. HTML in the surrounding prose, such as a literal <table> or a quoted copy of the original table, is parsed as part of the result. The editor then replaces the table data with an empty table or with the original table.

This change converts the extracted code block, as convert_html_to_docling_document and convert_markdown_to_docling_document already do. When the reply has no code block, the full reply is still converted.

Resolves #61

Tests

  • Add test_convert_html_to_docling_table_ignores_prose_mentioning_tags and test_convert_html_to_docling_table_ignores_tables_outside_code_block to tests/test_base_functions.py. Both fail on main and pass with the fix.
  • pytest -m "not slow" tests: 166 passed, 3 skipped (base install).
  • ruff check, ruff format --check and mypy docling_agent pass.

Signed-off-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @RaphaelFakhri, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 2 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 Require two reviewer for test updates 👀 reviews
🟢 Enforce conventional commit —

🔴 Require two reviewer for test updates

Waiting for

  • #approved-reviews-by >= 1
This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 1

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

This branch has not been deployed

No deployments
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.

Table edits can wipe the table when the model reply mentions HTML tags outside the code block

1 participant