googleapis / googleapis/release-please

Updating arbitrary XML file removes space before self-closing tags

Open
#2,550 0 comments 0 reactions 1 assignee Claimed by @chingor13 View on GitHub
priority: p3 type: feature request
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.