Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumper mangles/escapes parts of XML file when using that content type #41

Closed
mhamann opened this issue Jan 11, 2025 · 4 comments · Fixed by #42
Closed

Bumper mangles/escapes parts of XML file when using that content type #41

mhamann opened this issue Jan 11, 2025 · 4 comments · Fixed by #42

Comments

@mhamann
Copy link

mhamann commented Jan 11, 2025

When using bumper to modify a specific element of an XML file, it replaced dollar signs and single quotes with an escaped or entity version.

Example:

// Bumper config
{
  "@release-it/bumper": {
      "in": "VERSION",
      "out": [
        {
          "file": "MyProject.csproj",
          "path": "Project > PropertyGroup > PackageVersion",
          "type": "application/xml"
        },
        "README.md",
        "VERSION"
      ]
    }
}
/* BEFORE */

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">26.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.1.2.1.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
/* AFTER */

<SupportedOSPlatformVersion Condition="&#x24;([MSBuild]::GetTargetPlatformIdentifier(&apos;&#x24;(TargetFramework)&apos;)) == &apos;android&apos;">26.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="&#x24;([MSBuild]::GetTargetPlatformIdentifier(&apos;&#x24;(TargetFramework)&apos;)) == &apos;ios&apos;">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="&#x24;([MSBuild]::GetTargetPlatformIdentifier(&apos;&#x24;(TargetFramework)&apos;)) == &apos;maccatalyst&apos;">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="&#x24;([MSBuild]::GetTargetPlatformIdentifier(&apos;&#x24;(TargetFramework)&apos;)) == &apos;windows&apos;">10.0.1.2.1.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="&#x24;([MSBuild]::GetTargetPlatformIdentifier(&apos;&#x24;(TargetFramework)&apos;)) == &apos;tizen&apos;">6.5</SupportedOSPlatformVersion>
@pbarton-andovercos
Copy link
Contributor

@mhamann, can you provide a simplified version of the XML structure for the csproj file that demonstrates this example so I can add a unit test and debug this issue? I just wanted to let you know that the provided example does not show the selector you are trying to update. I suspect this is related to the cheeriojs/cheerio#4045 issue, but I believe we can work around this similar to how we handled the HTML, as there were issues with Cheerio changing things.

@webpro
Copy link
Contributor

webpro commented Jan 20, 2025

🚀 This issue has been resolved in v7.0.1. See Release 7.0.1 for release notes.

@webpro
Copy link
Contributor

webpro commented Jan 20, 2025

Thanks to @pbarton-andovercos! Would be great if you could inform us if this fixes the issue, Matt?

@mhamann
Copy link
Author

mhamann commented Jan 21, 2025

Apologies for not posting a fuller reproduction. I just tested it and it's all fixed! Thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants