Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape format arguments passed to ui_label_set_markup() #1174

Merged
merged 2 commits into from Aug 20, 2016

Conversation

b4n
Copy link
Member

@b4n b4n commented Aug 10, 2016

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 to ui_label_new_bold(), which itself is implemented using ui_label_set_markup(). The documentation of ui_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).

@b4n b4n added the bug label Aug 10, 2016
@b4n b4n added this to the 1.29 milestone Aug 10, 2016
@codebrainz
Copy link
Member

An additional change could be to deprecate those UI functions for future privatisation, recommending callers to instead use GTK+ directly. This bug is a good case for doing so :)

@b4n
Copy link
Member Author

b4n commented Aug 10, 2016

Indeed, especially as there's no internal use of this function, and the only plugin I know using this is WebHelper which could easily do it on its own.

@elextr
Copy link
Member

elextr commented Aug 10, 2016

LGBI

Subtle bug.

For the API, its not documented as supporting markup, so this is a bugfix for an undocumented capability that leaked.

It has no usage inside Geany itself, had a bug in handling of markup
in the label, has only one user in Geany-Plugins, and is fairly easy
to reproduce.
@b4n
Copy link
Member Author

b4n commented Aug 19, 2016

@codebrainz @elextr added a commit to deprecate ui_frame_new_with_alignment().

@elextr
Copy link
Member

elextr commented Aug 20, 2016

Still LGBI

@b4n b4n self-assigned this Aug 20, 2016
@b4n b4n merged commit 29bffe6 into geany:master Aug 20, 2016
b4n added a commit that referenced this pull request Aug 20, 2016
Escape format arguments passed to ui_label_set_markup(), and deprecate
ui_frame_new_with_alignment() which exposed a broken API because of it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants