Skip to content

explorer 2026.11.18.2

Choose a tag to compare

@github-actions github-actions released this 18 Nov 20:39
· 8 commits to main since this release
348780c

fix(htmlsafe): pre-strip only whole block names (

is not ) (#80)

TLDR

Explorer's renderer removed everything from an email's <header>
element up to a later </head>, because its text pre-pass matched block
names by prefix. It now strips a script, style, head, title, meta or
link block only when the tag name is whole, so that content is shown.

Problem

stripBlocks (internal/htmlsafe/sanitize.go) matched preStripNames
with strings.HasPrefix, like the regex it replaced
((?is)<(script|…)[^>]*>.*?</\1>). <header> matched head and the
pass removed through the next </head>; likewise <scripts>,
<styled>, <titles>, <metadata>, <linkx>. Found while matching
the bare-link pass (#79) to the renderer.

Fix

  • wholeNameAt requires a space, / or > after the name, as the HTML
    tokenizer reads a tag name.
  • A real <head ...> block is still stripped; other elements are left
    to the tree sanitizer, unchanged.
  • PreStrip, and so the bare-URL download list, follows.

Tests

TestPrePassStripsOnlyWholeBlockNames: header, scripts, metadata and
linkx text is shown (fails on the previous code); a real head block with
attributes is still stripped. go vet, go build, go test ./...
(render golden included) and golangci-lint (0 issues) pass.

What's Changed

  • fix(htmlsafe): pre-strip only whole block names ( is not ) by @jzhao234 in #80

Full Changelog: v2026.11.18.1...v2026.11.18.2