Trim indent/newlines in text-based package metadata#627
Merged
Conversation
5d1c409 to
6cfe7eb
Compare
Member
Author
🧪 Details on Microsoft Windows 10.0.20348from dotnet-retest v0.7.1 on .NET 8.0.18 with 💜 by @devlooped |
c307578 to
32fe5df
Compare
This allows having newlines in the csproj while still compacting for packing.
The trimming involves:
* Removing blank lines at the beginning and ending of the value
* Determining indenting on the first line and using that to remove subsequent indenting in all following lines.
* Applying markdown rules to remove newlines: meaning only full paragraph separating newlines (blank) will be kept.
* Collapse multiple blank newlines into just one (when separating paragraphs).
This means you can indent nicely in the XML (as VS does by default) while still keeping a clean and compact representation in the package. For example:
```xml
<Description>
Create, edit and run multiple C# top-level programs in the same project,
respecting per-file `#:package` references and `#:property` 😍
</Description>
```
Would become a single line of text.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This allows having newlines in the csproj while still compacting for packing.
The trimming involves:
This means you can indent nicely in the XML (as VS does by default) while still keeping a clean and compact representation in the package. For example:
Would become a single line of text.