feat(html): warn on the element types the renderer drops, instead of dropping them silently - #805
Merged
Merged
Conversation
…dropping them silently `translate_element`'s `default:` carried a `// TODO log` and threw the element and its whole subtree away without a word. It now names the type through `state.logger()`, which `WritingState` has carried all along. The corpus test was handing the renderer the null logger, so nothing it reported has ever been read; it now passes one, at warning level so the pdf and svm per-operator debug output does not bury the run. Across the whole corpus that measures exactly one gap: 312 dropped `page_break` elements in 30 files, 240 in odt and 72 in doc. No other element type reaches the default case. Towards #150. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018cMYRXLJdiCkH65Jm2W9B5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code
The render half of #150.
translate_element'sdefault:carried a// TODO logand threw the element and its whole subtree away without a word. It now names the type throughstate.logger(), whichWritingStatehas carried all along.element_type_nameis a switch over everyElementTypeenumerator with nodefault, so a type added to the enum has to be named here too or the build stops.The corpus test was logging into the void
html_output_test.cppcalled the three-argumenthtml::translate, so the renderer gotLogger::null()— nothing it has ever reported was read. It now gets a logger, at warning level: at verbose the pre-existing per-pdf-operator and per-svm-action debug lines take the run from 1.7k to 23k lines and bury everything. At warning it is 2.0k lines.What the corpus says
That is the point of the issue — turning "support X" into a ranking. Over all 281 corpus renders:
page_breakNothing else.
page_breakis the renderer's only element-level gap, 240 of them inodtand 72 indoc. Worst offenders:efficiency+style-big+various-1.odt(87),785KB.doc(64),style+svm-various-1.odt(38).That is #174, and it now has a number on it.
The only other warning the whole corpus raises is one pdf cross-reference recovery.
Verification
./odr_test --gtest_filter='all_test_files/HtmlOutputTests.*'— 281 tests, pass.