Escape format arguments passed to ui_label_set_markup() #1174
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.
A good example of why is the changes to
ui_menu_add_document_items_sorted()
: the format should contain markup, but the placeholders should not (they will generally be mostly unknown text).This however has one side effect on the API:
ui_frame_new_with_alignment()
's first argument is passed as-is toui_label_new_bold()
, which itself is implemented usingui_label_set_markup()
. The documentation ofui_frame_new_with_alignment()
never suggested it supported markup (and none of the users I could fine did expect that), but it's a change in how the API works.IMO it's a bug fix (markup control character no longer break frame labels), but someone could see it as a feature removal (although it'd be somewhat dishonest as it never was advertized).