diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index a68aa0829e..1a780ea343 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -404,11 +404,14 @@ module Homebrew # maximum length of PR body is 65,536 characters so let's truncate release notes to half of that. body = Formatter.truncate(github_release_data["body"], max: 32_768) + # Ensure the URL is properly HTML encoded to handle any quotes or other special characters + html_url = CGI.escapeHTML(github_release_data["html_url"]) + formula_pr_message += <<~XML
#{pre}release notes
#{body}
-

View the full release notes at #{github_release_data["html_url"]}.

+

View the full release notes at #{html_url}.

XML end