redhat-developer / redhat-developer/vscode-xml
Strings with multiple whitespaces are formatted with single one
Open
Nobody has claimed this yet.
formatting
- Dominant language
- TypeScript
- Stars
- 328
- Forks
- 101
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 7
Description
Formatting this XML:
<Tag><Inner>Test Spaces</Inner></Tag>
leads to this:
<Tag>
<Inner>Test Spaces</Inner>
</Tag>
I am aware of #1017, and setting "files.trimTrailingWhitespace":false does not solve the problem. All multiple whitespaces are always formatted as single whitespce:
<Tag><Inner> Test Spaces </Inner></Tag>
becomes:
<Tag>
<Inner> Test Spaces </Inner>
</Tag>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the formatter behavior in vscode-xml using the XML examples in this issue, including leading, trailing, and internal whitespace runs. Trace the formatting entry point that collapses text content and verify that done means preserving multiple whitespaces while still applying the expected XML indentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100