Repository navigation
Draw list markers as text; engine v0.18.0 (escapes, counters) - #44
Merged
Merged
Conversation
List markers were never drawn: the engine lays an outside marker out on layout.Box.Marker, outside the line boxes paintBox walked. paintBox now draws Marker.Text (engine v0.18.0 gives every marker its text, a bullet too, with TextX/TextY/Ascent) through the same text path as a line's words, so the marker is real, extractable text in the PDF. An inside marker is already an inline item of the item's first line. Engine v0.18.0 also decodes CSS escapes (content: "\2022\00a0" painted the literal escape) and supports counter()/counters() with counter-reset/-increment/-set (go-webengine/engine#323). The tests read the PDF back with go-pdfkit/extract: markers in every list-style-type, start=, inside, escaped content, counter() and counters(), and a marker that follows its item to the next page. Without the paintMarker call they fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 28, 2026
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.
Three defects found on 2026-10-28 rendering a report through
html2pdf.Export:<ul><li>and<ol><li>showed the item text and its indent, no bullet, no number.contentwere painted literally —content: "\2022\00a0"printed\2022\00a0.counter()painted nothing.Fix
paintBoxnow drawslayout.Box.Marker: the engine lays an outside marker out there, outside the line boxes this package walked. Engine v0.18.0 gives every marker its text (a bullet too) withTextX/TextY/Ascent, andpaintMarkerdraws it through the same text path as a line's words (text, factored out ofpaintLine), so the marker is real, extractable text. An inside marker is already an inline item of the first line.github.com/go-webengine/enginev0.17.3 → v0.18.0 (css,layout,paint: list markers as text, CSS escapes, counters go-webengine/engine#323): CSS escapes decoded everywhere,counter()/counters()withcounter-reset/-increment/-set,list-style-typecounter styles and strings,::marker.Tests
lists_test.goreads the PDF back with go-pdfkit/extract: markers fordisc,start=3,upper-roman,inside, the escaped::before,counter(item),counters()over nested lists, and a marker that follows its item across a page break. Planted witness: with thepaintMarkercall removed the tests fail.Note: the extractor joins two drawn words with no space ("plain words" → "plainwords", on main too), so the test compares without spaces;
pdftotextreads the spaces.🤖 Generated with Claude Code