googleapis / googleapis/release-please
Updating arbitrary XML file removes space before self-closing tags
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 588
- Avg merge
- 12h 16m
- Merged PRs (30d)
- 7
Description
Given the following config (dotnet project)
```json
"extra-files": [
{
"type": "xml",
"path": "src/Directory.Build.props",
"xpath": "//Project/PropertyGroup/VersionPrefix"
}
]
```
works as expected, but removes spaces before self-closing tags, eg.
```diff
-
+
```
This issue has been discussed upstream here https://github.com/xmldom/xmldom/issues/465
Would you accept a simple PR like this:
https://github.com/googleapis/release-please/blob/main/src/updaters/base-xml.ts#L32
```diff
- const newContent = new dom.XMLSerializer().serializeToString(document);
+ const newContent = new dom.XMLSerializer().serializeToString(document).replaceAll('/>', ' />’);
```
Contributor guide
Assessment
This issue has not been assessed yet.