Support newlines in GUI description field #2818
Merged
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.
Problem
It was noted in #2796 that line breaks in module descriptions work on Mono but not Windows:
Cause
Mono uses "\n" to split lines because it runs on Unix.
Windows uses "\r\n" to split lines because CP/M did in 1974.
The
TextBox
implementations carry this difference through to 2019.Changes
Now we will replace both
\r\n
and\n
withEnvironment.Newline
, which contains the string used by the current platform to break lines. This way authors may include either\r\n
or\n
in descriptions and it will always display correctly.Note that this is not a fix for #2796 because that issue also requests bold and italic.