From b13f05537b6bbf2f0160af2b4ad6a60f3fa9aa1d Mon Sep 17 00:00:00 2001 From: sunce Date: Sun, 15 Jan 2023 14:17:07 +0800 Subject: [PATCH] Escape GtkBuilder XML tag in comment with backtick Escape XML tags in gi-docgen oriented comment e.g. from to ``, so that they don't become HTML tag on the final webpage. This fix includes everything from commit ff46ea64 and #5312. Fixes #5312 --- gtk/css/gtkcssparser.c | 2 +- gtk/deprecated/gtkcomboboxtext.c | 4 ++-- gtk/deprecated/gtktreestore.c | 4 ++-- gtk/gtkbuildable.c | 4 ++-- gtk/gtkbuildable.h | 6 +++--- gtk/gtkbuilder.c | 4 ++-- gtk/gtkbuilderscope.h | 2 +- gtk/gtkcenterbox.c | 2 +- gtk/gtkentry.c | 4 ++-- gtk/gtkexpander.c | 4 ++-- gtk/gtkframe.c | 4 ++-- gtk/gtkheaderbar.c | 2 +- gtk/gtklabel.c | 2 +- gtk/gtklevelbar.c | 4 ++-- gtk/gtklistbase.c | 4 ++-- gtk/gtklistbox.c | 2 +- gtk/gtknotebook.c | 6 +++--- gtk/gtkscale.c | 4 ++-- gtk/gtkshortcutsshortcut.c | 16 ++++++++-------- gtk/gtksizegroup.c | 6 +++--- gtk/gtkstringlist.c | 4 ++-- gtk/gtktexttagtable.c | 2 +- gtk/gtkwindow.c | 2 +- 23 files changed, 47 insertions(+), 47 deletions(-) diff --git a/gtk/css/gtkcssparser.c b/gtk/css/gtkcssparser.c index 7b0cbcdaeb..d300ec2d0e 100644 --- a/gtk/css/gtkcssparser.c +++ b/gtk/css/gtkcssparser.c @@ -962,7 +962,7 @@ gtk_css_parser_parse_url_arg (GtkCssParser *parser, * gtk_css_parser_consume_url: * @self: a `GtkCssParser` * - * If the parser matches the token from the [CSS + * If the parser matches the `` token from the [CSS * specification](https://drafts.csswg.org/css-values-4/#url-value), * consumes it, resolves the URL and returns the resulting `GFile`. * On failure, an error is emitted and %NULL is returned. diff --git a/gtk/deprecated/gtkcomboboxtext.c b/gtk/deprecated/gtkcomboboxtext.c index 1fae027a4a..1ddaa6c75e 100644 --- a/gtk/deprecated/gtkcomboboxtext.c +++ b/gtk/deprecated/gtkcomboboxtext.c @@ -59,8 +59,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS * ## GtkComboBoxText as GtkBuildable * * The `GtkComboBoxText` implementation of the `GtkBuildable` interface supports - * adding items directly using the element and specifying - * elements for each item. Each element can specify the “id” + * adding items directly using the `` element and specifying `` + * elements for each item. Each `` element can specify the “id” * corresponding to the appended text and also supports the regular * translation attributes “translatable”, “context” and “comments”. * diff --git a/gtk/deprecated/gtktreestore.c b/gtk/deprecated/gtktreestore.c index d4bda677f8..684f5034aa 100644 --- a/gtk/deprecated/gtktreestore.c +++ b/gtk/deprecated/gtktreestore.c @@ -47,8 +47,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS * ## GtkTreeStore as GtkBuildable * * The GtkTreeStore implementation of the `GtkBuildable` interface allows - * to specify the model columns with a element that may contain - * multiple elements, each specifying one model column. The “type” + * to specify the model columns with a `` element that may contain + * multiple `` elements, each specifying one model column. The “type” * attribute specifies the data type for the column. * * An example of a UI Definition fragment for a tree store: diff --git a/gtk/gtkbuildable.c b/gtk/gtkbuildable.c index 6dfde21f69..492bf8dfd6 100644 --- a/gtk/gtkbuildable.c +++ b/gtk/gtkbuildable.c @@ -80,7 +80,7 @@ gtk_buildable_set_buildable_id (GtkBuildable *buildable, * Gets the ID of the @buildable object. * * `GtkBuilder` sets the name based on the ID attribute - * of the tag used to construct the @buildable. + * of the `` tag used to construct the @buildable. * * Returns: (nullable): the ID of the buildable object **/ @@ -193,7 +193,7 @@ gtk_buildable_construct_child (GtkBuildable *buildable, * @data: (out): return location for user data that will be passed in * to parser functions * - * This is called for each unknown element under . + * This is called for each unknown element under ``. * * Returns: %TRUE if an object has a custom implementation, %FALSE * if it doesn't. diff --git a/gtk/gtkbuildable.h b/gtk/gtkbuildable.h index f2498aea12..9b0af914e0 100644 --- a/gtk/gtkbuildable.h +++ b/gtk/gtkbuildable.h @@ -109,14 +109,14 @@ struct _GtkBuildableParser * interface is created. * @construct_child: Constructs a child of a buildable that has been * specified as “constructor” in the UI definition. This can be used to - * reference a widget created in a tag which is outside + * reference a widget created in a `` tag which is outside * of the normal GtkBuilder UI definition hierarchy. A reference to the * constructed object is returned and becomes owned by the caller. * @custom_tag_start: Implement this if the buildable needs to parse - * content below . To handle an element, the implementation + * content below ``. To handle an element, the implementation * must fill in the @parser and @user_data and return %TRUE. * `GtkWidget` implements this to parse accessible attributes specified - * in elements. + * in `` elements. * Note that @user_data must be freed in @custom_tag_end or @custom_finished. * @custom_tag_end: Called for the end tag of each custom element that is * handled by the buildable (see @custom_tag_start). diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index 36f3a1edcb..40dea50c08 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -192,9 +192,9 @@ * * Beyond this general structure, several object classes define their * own XML DTD fragments for filling in the ANY placeholders in the DTD - * above. Note that a custom element in a element gets parsed by + * above. Note that a custom element in a `` element gets parsed by * the custom tag handler of the parent object, while a custom element in - * an element gets parsed by the custom tag handler of the object. + * an `` element gets parsed by the custom tag handler of the object. * * These XML fragments are explained in the documentation of the * respective objects. diff --git a/gtk/gtkbuilderscope.h b/gtk/gtkbuilderscope.h index 5ab602fc06..59e2928cef 100644 --- a/gtk/gtkbuilderscope.h +++ b/gtk/gtkbuilderscope.h @@ -57,7 +57,7 @@ typedef enum { /*< prefix=GTK_BUILDER_CLOSURE >*/ * correct function name for registering the type and then use dlsym() to load it. * The default implementation just tries g_type_from_name() and otherwise fails. * @get_type_from_function: Try to lookup a `GType` via the given function name, specified - * explicitly in a GtkBuilder file, like via the "type-func" attribute in the "" tag. + * explicitly in a GtkBuilder file, like via the "type-func" attribute in the `` tag. * This function is very rarely used. * The C implementation will use dlsym() and call the resulting function as a `GTypeFunc`. * The default implementation will fail and just return %G_TYPE_INVALID. diff --git a/gtk/gtkcenterbox.c b/gtk/gtkcenterbox.c index dc826f027f..97bce16698 100644 --- a/gtk/gtkcenterbox.c +++ b/gtk/gtkcenterbox.c @@ -37,7 +37,7 @@ * * The `GtkCenterBox` implementation of the `GtkBuildable` interface * supports placing children in the 3 positions by specifying “start”, “center” - * or “end” as the “type” attribute of a element. + * or “end” as the “type” attribute of a `` element. * * # CSS nodes * diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 2cc428a1c5..6fd837a276 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -135,8 +135,8 @@ * # GtkEntry as GtkBuildable * * The `GtkEntry` implementation of the `GtkBuildable` interface supports a - * custom element, which supports any number of - * elements. The element has attributes named “name“, “value“, + * custom `` element, which supports any number of `` + * elements. The `` element has attributes named “name“, “value“, * “start“ and “end“ and allows you to specify `PangoAttribute` values for * this label. * diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c index 016e7f864e..6b233ebe59 100644 --- a/gtk/gtkexpander.c +++ b/gtk/gtkexpander.c @@ -79,8 +79,8 @@ * * The `GtkExpander` implementation of the `GtkBuildable` interface supports * placing a child in the label position by specifying “label” as the - * “type” attribute of a element. A normal content child can be - * specified without specifying a type attribute. + * “type” attribute of a `` element. A normal content child can be + * specified without specifying a `` type attribute. * * An example of a UI definition fragment with GtkExpander: * diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index 85c272a441..9ec452b259 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -51,8 +51,8 @@ * * The `GtkFrame` implementation of the `GtkBuildable` interface supports * placing a child in the label position by specifying “label” as the - * “type” attribute of a element. A normal content child can - * be specified without specifying a type attribute. + * “type” attribute of a `` element. A normal content child can + * be specified without specifying a `` type attribute. * * An example of a UI definition fragment with GtkFrame: * ```xml diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c index fa560bb341..1044409617 100644 --- a/gtk/gtkheaderbar.c +++ b/gtk/gtkheaderbar.c @@ -61,7 +61,7 @@ * * The `GtkHeaderBar` implementation of the `GtkBuildable` interface supports * adding children at the start or end sides by specifying “start” or “end” as - * the “type” attribute of a element, or setting the title widget by + * the “type” attribute of a `` element, or setting the title widget by * specifying “title” value. * * By default the `GtkHeaderBar` uses a `GtkLabel` displaying the title of the diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 4228fb38ae..6f3fbe449e 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -94,7 +94,7 @@ * # GtkLabel as GtkBuildable * * The GtkLabel implementation of the GtkBuildable interface supports a - * custom element, which supports any number of + * custom `` element, which supports any number of `` * elements. The element has attributes named “name“, “value“, * “start“ and “end“ and allows you to specify [struct@Pango.Attribute] * values for this label. diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c index ef41b5ec17..426f97f465 100644 --- a/gtk/gtklevelbar.c +++ b/gtk/gtklevelbar.c @@ -90,8 +90,8 @@ * # GtkLevelBar as GtkBuildable * * The `GtkLevelBar` implementation of the `GtkBuildable` interface supports a - * custom element, which can contain any number of elements, - * each of which must have name and value attributes. + * custom `` element, which can contain any number of `` elements, + * each of which must have "name" and "value" attributes. * * # CSS nodes * diff --git a/gtk/gtklistbase.c b/gtk/gtklistbase.c index d77088481a..7d829ef3b8 100644 --- a/gtk/gtklistbase.c +++ b/gtk/gtklistbase.c @@ -378,10 +378,10 @@ gtk_list_base_get_allocation_across (GtkListBase *self, * @pos: item to select * @modify: %TRUE if the selection should be modified, %FALSE * if a new selection should be done. This is usually set - * to %TRUE if the user keeps the key pressed. + * to %TRUE if the user keeps the `` key pressed. * @extend_pos: %TRUE if the selection should be extended. * Selections are usually extended from the last selected - * position if the user presses the key. + * position if the user presses the `` key. * * Selects the item at @pos according to how GTK list widgets modify * selections, both when clicking rows with the mouse or when using diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index 08730eb4da..7a2888df01 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -66,7 +66,7 @@ * * The `GtkListBox` implementation of the `GtkBuildable` interface supports * setting a child as the placeholder by specifying “placeholder” as the “type” - * attribute of a element. See [method@Gtk.ListBox.set_placeholder] + * attribute of a `` element. See [method@Gtk.ListBox.set_placeholder] * for info. * * # CSS nodes diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 341dfd7f38..afdc350007 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -77,14 +77,14 @@ * * The `GtkNotebook` implementation of the `GtkBuildable` interface * supports placing children into tabs by specifying “tab” as the - * “type” attribute of a element. Note that the content + * “type” attribute of a `` element. Note that the content * of the tab must be created before the tab can be filled. - * A tab child can be specified without specifying a + * A tab child can be specified without specifying a `` * type attribute. * * To add a child widget in the notebooks action area, specify * "action-start" or “action-end” as the “type” attribute of the - * element. + * `` element. * * An example of a UI definition fragment with `GtkNotebook`: * diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c index 4e61fb3c9e..22dfeeb333 100644 --- a/gtk/gtkscale.c +++ b/gtk/gtkscale.c @@ -64,8 +64,8 @@ * * # GtkScale as GtkBuildable * - * `GtkScale` supports a custom element, which can contain multiple - * elements. The “value” and “position” attributes have the same + * `GtkScale` supports a custom `` element, which can contain multiple + * `` elements. The “value” and “position” attributes have the same * meaning as [method@Gtk.Scale.add_mark] parameters of the same name. If * the element is not empty, its content is taken as the markup to show at * the mark. It can be translated with the usual ”translatable” and diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c index 606a4543fe..9c1cd8ca47 100644 --- a/gtk/gtkshortcutsshortcut.c +++ b/gtk/gtkshortcutsshortcut.c @@ -555,22 +555,22 @@ gtk_shortcuts_shortcut_class_init (GtkShortcutsShortcutClass *klass) * by separating them with a space, but keep in mind that the available width * is limited. * - * It is also possible to specify ranges of shortcuts, using "..." between - * the keys. Sequences of keys can be specified using a "+" or "&" between + * It is also possible to specify ranges of shortcuts, using `...` between + * the keys. Sequences of keys can be specified using a `+` or `&` between * the keys. * * Examples: * - * - A single shortcut: delete - * - Two alternative shortcuts: a Home - * - A range of shortcuts: 1...9 - * - Several keys pressed together: Control_L&Control_R - * - A sequence of shortcuts or keys: c+x + * - A single shortcut: `delete` + * - Two alternative shortcuts: `a Home` + * - A range of shortcuts: `1...9` + * - Several keys pressed together: `Control_L&Control_R` + * - A sequence of shortcuts or keys: `c+x` * * Use "+" instead of "&" when the keys may (or have to be) pressed * sequentially (e.g use "t+t" for 'press the t key twice'). * - * Note that <, > and & need to be escaped as <, > and & when used + * Note that `<`, `>` and `&` need to be escaped as `<`, `>`; and `&`; when used * in .ui files. */ properties[PROP_ACCELERATOR] = diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c index a8b6a27d6c..6dba79ae18 100644 --- a/gtk/gtksizegroup.c +++ b/gtk/gtksizegroup.c @@ -79,10 +79,10 @@ * * # GtkSizeGroup as GtkBuildable * - * Size groups can be specified in a UI definition by placing an + * Size groups can be specified in a UI definition by placing an `` * element with `class="GtkSizeGroup"` somewhere in the UI definition. The - * widgets that belong to the size group are specified by a element - * that may contain multiple elements, one for each member of the + * widgets that belong to the size group are specified by a `` element + * that may contain multiple `` elements, one for each member of the * size group. The ”name” attribute gives the id of the widget. * * An example of a UI definition fragment with `GtkSizeGroup`: diff --git a/gtk/gtkstringlist.c b/gtk/gtkstringlist.c index 0f4052e96f..ffd3d5c61e 100644 --- a/gtk/gtkstringlist.c +++ b/gtk/gtkstringlist.c @@ -38,8 +38,8 @@ * # GtkStringList as GtkBuildable * * The `GtkStringList` implementation of the `GtkBuildable` interface - * supports adding items directly using the element and - * specifying elements for each item. Each element + * supports adding items directly using the `` element and + * specifying `` elements for each item. Each `` element * supports the regular translation attributes “translatable”, * “context” and “comments”. * diff --git a/gtk/gtktexttagtable.c b/gtk/gtktexttagtable.c index 2052d38242..ad7dc95d83 100644 --- a/gtk/gtktexttagtable.c +++ b/gtk/gtktexttagtable.c @@ -50,7 +50,7 @@ * * The `GtkTextTagTable` implementation of the `GtkBuildable` interface * supports adding tags by specifying “tag” as the “type” attribute - * of a element. + * of a `` element. * * An example of a UI definition fragment specifying tags: * ```xml diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 88cc0b71ab..e721aeaa07 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -119,7 +119,7 @@ * * The `GtkWindow` implementation of the [iface@Gtk.Buildable] interface supports * setting a child as the titlebar by specifying “titlebar” as the “type” - * attribute of a element. + * attribute of a `` element. * * # CSS nodes * -- 2.30.2