Repository navigation
Conversation
The HTML backend ignored <svg>, so its <title> leaked into body text and no picture was created. Emit a PictureItem the way <img> is handled: <title> becomes the caption, <desc> is stored as a description, and decorative SVG (aria-hidden, role=presentation/none) is skipped. soup.title also picked up an SVG title as the document title; only a non-SVG <title> is used for that now. <video>/<audio> TrackItem handling is left for a follow-up, after a maintainer confirms the contract in docling-project#4766. Signed-off-by: er-s-an <92594860+er-s-an@users.noreply.github.com>
|
✅ DCO Check Passed Thanks @er-s-an, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit The HTML backend now turns an inline CI safety: no concern found. A maintainer must still approve CI. 3 related pull request(s) in the same code
The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at 87def67c60. It read the code and did not run it.
The change drops all visible text inside an inline <svg> (for example <text> labels in charts). It keeps only <title> and <desc>. The PR description does not say this, and no test covers it. The reviewer must decide whether this loss is accepted for all HTML inputs.
A maintainer makes the merge decision. This review never approves the pull request.
| tag = cast(Tag, item) | ||
| if self._is_suppressed_tag(tag): | ||
| return AnnotatedTextList() | ||
| if tag.name == "svg": |
There was a problem hiding this comment.
question: Visible <text> content of an inline SVG is dropped without a replacement
_extract_text_and_hyperlink_recursively now returns an empty list for every <svg>. Before this change, the text of <text>, <tspan>, and similar children was part of the body text. Now only <title> and <desc> are read, in _svg_child_text and _emit_svg. The PR emits no <text> content anywhere, and the code comment says it "belongs to the picture".
Example: <p>Revenue <svg><text x="0" y="10">Q1: 40%</text></svg></p> loses Q1: 40%. The result is a captionless picture. Charts and diagrams with SVG labels hit this case. A bare <svg> icon with no <title> also becomes an empty PictureItem for every user.
The PR text and the 9 new tests cover neither case. Please state whether this loss of <text> content is accepted. If it is not, keep the text in a form such as PictureMeta.description, or as body text when no <title> exists. Add a test for an SVG that has <text> and no <title>.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the changes since 87def67c60 at 85909129ce. It read the code and did not run it.
The incremental diff only merges unrelated changes from the base branch: VLM, CLI, and a CHANGELOG entry. It does not touch docling/backend/html_backend.py or tests/test_backend_html.py. The earlier open question stays open: the author has not said whether the loss of SVG <text> content is accepted.
Earlier findings
- open (question): Visible
<text>content of an inline SVG is dropped without a replacement
A maintainer makes the merge decision. This review never approves the pull request.
…icture Signed-off-by: er-s-an <92594860+er-s-an@users.noreply.github.com>
The HTML backend had no handling for an inline
<svg>. Its<title>was merged into the surrounding body text, and no picture was created. This is the SVG half of the contract on #4766.After this change:
<svg>becomes aPictureItem, the same way<img>does<title>is the caption (a<figcaption>still wins when the SVG is in a figure)<desc>is stored asPictureMeta.descriptionaria-hidden="true",role="presentation",role="none"<title>is no longer used as the HTML document titleCovered in paragraphs, list items, table cells, and a list item that holds only an SVG.
<video>/<audio>(TrackItemafter #4752) is left for a follow-up, once a maintainer confirms that direction on #4766.Checklist:
Review evidence:
Before, the #4766 repro printed body text
Before Icon afterand created no picture for the SVG. After, the paragraph text isBefore after(same spacing as an inline<img>), onePictureItemis created with captionIcon, and<desc>lands inpicture.meta.description. Decorative SVG is omitted and does not leak its title.uv run pytest tests/test_backend_html.py: 184 passed, 1 skipped, including 9 new SVG cases. No reference documents were regenerated.