Skip to content

RS-22478: sanitize scatter labels and annotations with DOMPurify#92

Open
chschan wants to merge 1 commit into
masterfrom
RS-22478-sanitize-labels
Open

RS-22478: sanitize scatter labels and annotations with DOMPurify#92
chschan wants to merge 1 commit into
masterfrom
RS-22478-sanitize-labels

Conversation

@chschan

@chschan chschan commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Labels render as HTML so they can carry annotation markup (styled spans, HTML entities). .Sanitize the combined label HTML with DOMPurify in combineLabelsAndAnnotations, which keeps annotation formatting while stripping scripts and event handlers.

This replaces the reverted .text() approach (#90/#91), which broke annotation rendering and showed escaped entities literally. Adds the dompurify dependency and rebuilds the inst/htmlwidgets bundle.

Labels render as HTML so they can carry annotation markup (styled spans,
HTML entities). Base labels are already _.escape'd; annotations are raw
HTML. Sanitize the combined label HTML with DOMPurify in
combineLabelsAndAnnotations, which keeps annotation formatting while
stripping scripts and event handlers.

This replaces the reverted .text() approach (#90/#91), which broke
annotation rendering and showed escaped entities literally. Adds the
dompurify dependency and rebuilds the inst/htmlwidgets bundle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant