Repository navigation
Conversation
|
✅ DCO Check Passed Thanks @wittjeff, all your commits are properly signed off. 🎉 |
Merge Protections🔴 1 of 2 protections blocking · waiting on 👀 reviews
🔴 Require two reviewer for test updatesWaiting for
This rule is failing.When test data is updated, we require two reviewers
Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ributes in HTML Fixes docling-project#745. Markdown and plain text printed the pydantic repr of `LanguageMetaField` ("confidence=0.99 created_by='...' code=<HumanLanguageLabel.DE: 'de'>") as a paragraph because `_serialize_meta_field` had no branch for it. A language code is metadata, not content, so it now renders only under `mark_meta` ("[Language] de") and is skipped otherwise. HTML: `HTMLParams.html_lang` was declared but never emitted; the root is now `<html lang="...">` (WCAG 3.1.1). Text items whose `meta.language` differs from `html_lang` get their own `lang` attribute on the <p>/<hN> element (WCAG 3.1.2). The language row in the meta <details> block is unchanged. Regression tests added in test/test_metadata.py; the 23 HTML groundtruth files change only on the <html> line. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Jeff Witt <1848307+wittjeff@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Jeff Witt <1848307+wittjeff@users.noreply.github.com>
de09bb7 to
b46f4e8
Compare
AI triage (advisory)Checked commit The PR stops Topic labels added: CI safety: no concern found. A maintainer must still approve CI. Possible duplicates
2 related pull request(s) in the same code
Reference data changes
Assessment: expected. Each of the 23 HTML files changes by one line (+1/-1). This matches the change of the root tag from The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at b46f4e88f9. It read the code and did not run it.
No merge-deciding defect found. I checked the Markdown and plain-text language skip, the HTML <html lang> and element lang attributes, the attribute escaping in get_html_tag_with_text_direction, the subclasses of MarkdownMetaSerializer, and the new tests. The <html> line is the only change in the HTML reference data, as the PR describes.
A maintainer makes the merge decision. This review never approves the pull request.
Fixes #745.
What changed
Markdown / plain text.
MarkdownMetaSerializer._serialize_meta_fieldhad no branch forLanguageMetaField, so it fell through tostr(field_val)and the export gained a paragraph likeconfidence=0.99 created_by='langdetect' code=<HumanLanguageLabel.DE: 'de'>. A language code is metadata, not content: it now renders only whenmark_meta=True([Language] de) and is skipped otherwise. Plain text inherits the same serializer.HTML.
HTMLParams.html_langwas declared but never used; the root element was the literal"<html>". It is now<html lang="…">fromhtml_lang(default"en", unchanged) — WCAG 3.1.1 Language of Page.meta.languagediffers fromhtml_langget alangattribute on their<p>/<hN>element via the existingattrsparameter ofget_html_tag_with_text_direction— WCAG 3.1.2 Language of Parts. Items in the document language get no attribute, so output is unchanged for documents without language meta.<details>block is left as is (covered bytest_semantic_base_meta_fields_roundtrip_and_html_rendering).Tests
test_md_and_text_language_meta_is_not_rendered_as_proseandtest_html_declares_document_and_element_languagesintest/test_metadata.py.DOCLING_GEN_TEST_DATA=1: the 23 HTML files change only on the<html>line (PNG fixtures that regenerated with byte-level churn were reverted).pre-commit run --all-filesand the full suite pass locally (701 passed, 6 skipped).Context
Downstream, yra-doc-pipeline populates
meta.languagefrom a deterministic detector and maps it to PDF/UA/Lang; with this change the same data reaches the HTML export instead of leaking into text exports.🤖 Generated with Claude Code