Skip to content

fix(v2): escape XML special characters in macOS plist generation#5175

Draft
leaanthony wants to merge 3 commits intomasterfrom
v2-bugfix/4865-plist-xml-escaping
Draft

fix(v2): escape XML special characters in macOS plist generation#5175
leaanthony wants to merge 3 commits intomasterfrom
v2-bugfix/4865-plist-xml-escaping

Conversation

@leaanthony
Copy link
Copy Markdown
Member

Summary

When wails.json contains special characters like & in fields such as info.copyright, the generated Info.plist becomes invalid XML, breaking macOS packaging (broken app icon, launch failures).

The root cause is that resolveProjectData() in buildassets.go uses text/template, which performs no escaping. Switching to html/template ensures &, <, >, " are properly escaped in the plist output.

Before: "Joe & Bill, Inc.""Joe & Bill, Inc." (invalid XML)
After: "Joe & Bill, Inc.""Joe &amp; Bill, Inc." (valid XML)

Fixes #4865

Use html/template instead of text/template when processing plist
templates so that characters like &, <, > are properly escaped in
the generated Info.plist output.

Fixes #4865
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 51a99704-0972-4667-8926-cb4e93b15aac

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v2-bugfix/4865-plist-xml-escaping

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ampersand in wails.json breaks macOS packaging

1 participant