Draft
Conversation
There was a problem hiding this comment.
Pull request overview
Enables consumers of the marks pane underline renderer to customize underline appearance via passed-in SVG attributes, instead of hard-coded defaults.
Changes:
- Allow
fillto be overridden for the underline bounding<rect>. - Allow
stroke,stroke-width, andstroke-linecapto be overridden for the underline<line>. - Preserve existing visual defaults when no custom attributes are provided.
Comment on lines
+316
to
+326
| rect.setAttribute("fill", this.attributes.fill || "none"); | ||
|
|
||
| const line = svgCreate("line"); | ||
| line.setAttribute("x1", String(r.left - offset.left + container.left)); | ||
| line.setAttribute("x2", String(r.left - offset.left + container.left + r.width)); | ||
| line.setAttribute("y1", String(r.top - offset.top + container.top + r.height - 1)); | ||
| line.setAttribute("y2", String(r.top - offset.top + container.top + r.height - 1)); | ||
|
|
||
| line.setAttribute("stroke-width", "1"); | ||
| line.setAttribute("stroke", "black"); | ||
| line.setAttribute("stroke-linecap", "square"); | ||
| line.setAttribute("stroke-width", this.attributes["stroke-width"] || "1"); | ||
| line.setAttribute("stroke", this.attributes.stroke || "black"); | ||
| line.setAttribute("stroke-linecap", this.attributes["stroke-linecap"] || "square"); |
There was a problem hiding this comment.
The new underline style overrides (fill / stroke-width / stroke / stroke-linecap) aren’t covered by tests. There’s already a marks-pane test suite; consider adding a test that mocks Range.getClientRects to return at least one DOMRect so render() produces elements, then assert the generated / attributes reflect the provided attributes (and defaults when omitted).
williamchong
approved these changes
Mar 30, 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.
No description provided.