fix: escape @ in authors so nuspec XML stays valid (#389) - #603
Merged
Conversation
NuGet rejects an `@` character in the nuspec `<authors>` element (commonly present when the author is an email address), failing the build with "The '@' character ... cannot be included in a name". Strip `@` from `metadata.authors` before generating the nuspec, via a new exported `sanitizeAuthors` helper. The sanitization runs after `owners` and `copyright` default to `authors`, so those fields keep their original value since NuGet does not restrict them. Fixes #389
MarshallOfSound
approved these changes
Jun 28, 2026
MarshallOfSound
marked this pull request as ready for review
June 28, 2026 17:16
ckerr
approved these changes
Jun 29, 2026
|
🎉 This PR is included in version 5.4.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Samuel Attard · Slack thread
Before / After
Before: Generating an installer where the
authorsfield (or theauthorfrompackage.json) contains an@character — most commonly an email address — fails the build. NuGet rejects the@in the nuspec<authors>element withThe '@' character, hexadecimal value 0x40, cannot be included in a name, so the resulting nuspec XML is invalid andnuget packerrors out.After: The
@is stripped from the authors value before the nuspec is generated, so the XML stays valid and the build succeeds. Theownersandcopyrightfields are unaffected — NuGet does not restrict@there, so they keep their original value.How
Added an exported
sanitizeAuthorshelper insrc/index.tsthat removes@characters, and call it onmetadata.authorsincreateWindowsInstallerafterownersandcopyrighthave defaulted to the originalauthorsvalue. This keeps the diff minimal and leaves the unaffected defaults intact. A focused unit test inspec/sanitize-authors-spec.tscovers the@-in-authors case (mirroring the existingconvert-version-spec.tsstyle), so it verifies the sanitized value without running the full installer.Fixes #389
Generated by Claude Code