Escape ampersands in mod info abstract label #3429
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
If a mod has
&
in its abstract, it is hidden and the next character is underlind in the mod info abstract label:A similar issue with the mod list was fixed in #3149.
Cause
WinForms
Labels
(and some other controls) treat&
as a hotkey indicator; the next character in the text is used as the hotkey such that if you press Alt and that key, the control (or the next control in the tab order) receives focus. This is indicated visually by hiding the&
and underlining the next character.Usually it's not a good idea to expose this functionality to external data sources such as abstracts entered into SpaceDock; they generally just want the
&
to display normally, which is accomplished by doubling it to&&
.Changes
Now we double any ampersands in the abstract when populating them into the mod info abstract, which makes them display normally:
Fixes #3428.