Skip to content

fix(util): preserve escaped angle brackets across merged-PR double parse - #2906

Open
sylwit wants to merge 1 commit into
googleapis:mainfrom
sylwit:fix/pull-request-body-double-parse-2899
Open

sylwit wants to merge 1 commit into
googleapis:mainfrom
sylwit:fix/pull-request-body-double-parse-2899

Conversation

@sylwit

@sylwit sylwit commented Sep 25, 2026

Copy link
Copy Markdown

Manifest.findMergedReleasePullRequests parses the merged release PR body once, then calls toString() on the result and hands that string to every Strategy.buildRelease, which parses it a second time. extractMultipleReleases read each section's notes with textContent, which decodes htmlEscape's &lt;/&gt; back into a raw <word>. That raw tag survives into the reserialised body and breaks the second HTML parse, silently dropping whichever <details> section contains it (and any later sections nested inside it).

Read the notes with innerHTML instead: it preserves release-please's own escaping verbatim, so it round-trips through both parses without corrupting the DOM.

Fixes #2899

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

Manifest.findMergedReleasePullRequests parses the merged release PR
body once, then calls toString() on the result and hands that string
to every Strategy.buildRelease, which parses it a second time.
extractMultipleReleases read each section's notes with textContent,
which decodes htmlEscape's `&lt;`/`&gt;` back into a raw `<word>`.
That raw tag survives into the reserialised body and breaks the
second HTML parse, silently dropping whichever `<details>` section
contains it (and any later sections nested inside it).

Read the notes with innerHTML instead: it preserves release-please's
own escaping verbatim, so it round-trips through both parses without
corrupting the DOM.

Fixes googleapis#2899

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sylwit
sylwit requested review from a team as code owners September 25, 2026 02:48
@product-auto-label product-auto-label Bot added the size: s Pull request size is small. label Sep 25, 2026
@google-cla

google-cla Bot commented Sep 25, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manifest mode: release-time body re-parse decodes &lt;/&gt; and silently drops the component after a section with an escaped <word>

1 participant