Escape GtkBuilder XML tag in comment with backtick
authorsunce <sunce@ufl.edu>
Sun, 15 Jan 2023 06:17:07 +0000 (14:17 +0800)
committersunce <sunce@ufl.edu>
Sun, 15 Jan 2023 08:55:18 +0000 (16:55 +0800)
Escape XML tags in gi-docgen oriented comment e.g. from <child> to
`<child>`, so that they don't become HTML tag on the final webpage.
This fix includes everything from commit ff46ea64 and #5312.

Fixes #5312

23 files changed:
gtk/css/gtkcssparser.c
gtk/deprecated/gtkcomboboxtext.c
gtk/deprecated/gtktreestore.c
gtk/gtkbuildable.c
gtk/gtkbuildable.h
gtk/gtkbuilder.c
gtk/gtkbuilderscope.h
gtk/gtkcenterbox.c
gtk/gtkentry.c
gtk/gtkexpander.c
gtk/gtkframe.c
gtk/gtkheaderbar.c
gtk/gtklabel.c
gtk/gtklevelbar.c
gtk/gtklistbase.c
gtk/gtklistbox.c
gtk/gtknotebook.c
gtk/gtkscale.c
gtk/gtkshortcutsshortcut.c
gtk/gtksizegroup.c
gtk/gtkstringlist.c
gtk/gtktexttagtable.c
gtk/gtkwindow.c

index 7b0cbcdaeb0d06ae525b363ad89430dea221e566..d300ec2d0ed296ee80e1c5c886759092a8903603 100644 (file)
@@ -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 <url> token from the [CSS
+ * If the parser matches the `<url>` 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.
index 1fae027a4a198809a59e96fb9413dfef4cca17d0..1ddaa6c75e70e8318aa438fb5dcff1c27c8aa4de 100644 (file)
@@ -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 <items> element and specifying <item>
- * elements for each item. Each <item> element can specify the “id”
+ * adding items directly using the `<items>` element and specifying `<item>`
+ * elements for each item. Each `<item>` element can specify the “id”
  * corresponding to the appended text and also supports the regular
  * translation attributes “translatable”, “context” and “comments”.
  *
index d4bda677f893b9584cdbffc69072062f334cf81b..684f5034aa3f4cc4c11de273edba96bffee2c192 100644 (file)
@@ -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 <columns> element that may contain
- * multiple <column> elements, each specifying one model column. The “type”
+ * to specify the model columns with a `<columns>` element that may contain
+ * multiple `<column>` 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:
index 6dfde21f69db2119c8327300d5ac0e22477995ba..492bf8dfd6146aea42a35ad66eabf1a602abd5e3 100644 (file)
@@ -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 <object> tag used to construct the @buildable.
+ * of the `<object>` 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 <child>.
+ * This is called for each unknown element under `<child>`.
  *
  * Returns: %TRUE if an object has a custom implementation, %FALSE
  *   if it doesn't.
index f2498aea1209832b5e3a181263a1a40b190bfe05..9b0af914e085c4b65bed02aceac91ea11ac0bf9b 100644 (file)
@@ -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 <ui> tag which is outside
+ *  reference a widget created in a `<ui>` 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 <child>. To handle an element, the implementation
+ *  content below `<child>`. 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 <accessibility> elements.
+ *  in `<accessibility>` 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).
index 36f3a1edcb2ae9bc3d7ce8197868fda88e53f6e5..40dea50c087e4a3e888cc097ba6ce9e29a0d6485 100644 (file)
  *
  * 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 <child> element gets parsed by
+ * above. Note that a custom element in a `<child>` element gets parsed by
  * the custom tag handler of the parent object, while a custom element in
- * an <object> element gets parsed by the custom tag handler of the object.
+ * an `<object>` element gets parsed by the custom tag handler of the object.
  *
  * These XML fragments are explained in the documentation of the
  * respective objects.
index 5ab602fc067daf8601da7cebfe9e35840f9bea23..59e2928cef44819e9599642a1a4ed8aae2025d01 100644 (file)
@@ -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 "<object>" tag.
+ *   explicitly in a GtkBuilder file, like via the "type-func" attribute in the `<object>` 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.
index dc826f027f46b8d8f83a1f559772241174588b01..97bce166989b474d1d1c9e7542e091d2cc3ff041 100644 (file)
@@ -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 <child> element.
+ * or “end” as the “type” attribute of a `<child>` element.
  *
  * # CSS nodes
  *
index 2cc428a1c5b2a8a67449ac7af50eb8ce49754190..6fd837a2769a298f86e0f05735c2f19555be9716 100644 (file)
  * # GtkEntry as GtkBuildable
  *
  * The `GtkEntry` implementation of the `GtkBuildable` interface supports a
- * custom <attributes> element, which supports any number of <attribute>
- * elements. The <attribute> element has attributes named “name“, “value“,
+ * custom `<attributes>` element, which supports any number of `<attribute>`
+ * elements. The `<attribute>` element has attributes named “name“, “value“,
  * “start“ and “end“ and allows you to specify `PangoAttribute` values for
  * this label.
  *
index 016e7f864e4745aaf2b59ddded115390265b43d3..6b233ebe5967183c4eb031a970e5a2952eb90d01 100644 (file)
@@ -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 <child> element. A normal content child can be
- * specified without specifying a <child> type attribute.
+ * “type” attribute of a `<child>` element. A normal content child can be
+ * specified without specifying a `<child>` type attribute.
  *
  * An example of a UI definition fragment with GtkExpander:
  *
index 85c272a44192a032689f336771c471fd0bf155dc..9ec452b25983c5953f681e5c84609bdba3f2202f 100644 (file)
@@ -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 <child> element. A normal content child can
- * be specified without specifying a <child> type attribute.
+ * “type” attribute of a `<child>` element. A normal content child can
+ * be specified without specifying a `<child>` type attribute.
  *
  * An example of a UI definition fragment with GtkFrame:
  * ```xml
index fa560bb3412e71bf72465825461c1312e40de8b7..1044409617454267ca5b5f65bf843f9439dc736e 100644 (file)
@@ -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 <child> element, or setting the title widget by
+ * the “type” attribute of a `<child>` element, or setting the title widget by
  * specifying “title” value.
  *
  * By default the `GtkHeaderBar` uses a `GtkLabel` displaying the title of the
index 4228fb38aec7c4f051d91b1216d8ce06c4b9184a..6f3fbe449e605556aaa120c2e83b7118c4e3b556 100644 (file)
@@ -94,7 +94,7 @@
  * # GtkLabel as GtkBuildable
  *
  * The GtkLabel implementation of the GtkBuildable interface supports a
- * custom <attributes> element, which supports any number of <attribute>
+ * custom `<attributes>` element, which supports any number of `<attribute>`
  * elements. The <attribute> element has attributes named “name“, “value“,
  * “start“ and “end“ and allows you to specify [struct@Pango.Attribute]
  * values for this label.
index ef41b5ec17726eb6cdbaad35f637aa2bc1c81600..426f97f465f864b6cc95fca24a0820c63fc6c993 100644 (file)
@@ -90,8 +90,8 @@
  * # GtkLevelBar as GtkBuildable
  *
  * The `GtkLevelBar` implementation of the `GtkBuildable` interface supports a
- * custom <offsets> element, which can contain any number of <offset> elements,
- * each of which must have name and value attributes.
+ * custom `<offsets>` element, which can contain any number of `<offset>` elements,
+ * each of which must have "name" and "value" attributes.
  *
  * # CSS nodes
  *
index d77088481ab2b6113497a5548d7daff494140ec3..7d829ef3b856d60249bbb963978d74eed6da2e18 100644 (file)
@@ -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 <Shift> key pressed.
+ *   to %TRUE if the user keeps the `<Shift>` 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 <Ctrl> key.
+ *   position if the user presses the `<Ctrl>` key.
  *
  * Selects the item at @pos according to how GTK list widgets modify
  * selections, both when clicking rows with the mouse or when using
index 08730eb4dab5758fad2a0d2be770d289b841189f..7a2888df01d6704cda2eca3427a6794eea9a4bb9 100644 (file)
@@ -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 <child> element. See [method@Gtk.ListBox.set_placeholder]
+ * attribute of a `<child>` element. See [method@Gtk.ListBox.set_placeholder]
  * for info.
  *
  * # CSS nodes
index 341dfd7f38b646118d4035a6deb431c76d16f870..afdc35000700861405efefb7329ace1751d2190d 100644 (file)
  *
  * The `GtkNotebook` implementation of the `GtkBuildable` interface
  * supports placing children into tabs by specifying “tab” as the
- * “type” attribute of a <child> element. Note that the content
+ * “type” attribute of a `<child>` 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 <child>
+ * A tab child can be specified without specifying a `<child>`
  * type attribute.
  *
  * To add a child widget in the notebooks action area, specify
  * "action-start" or “action-end” as the “type” attribute of the
- * <child> element.
+ * `<child>` element.
  *
  * An example of a UI definition fragment with `GtkNotebook`:
  *
index 4e61fb3c9ef17263c48b193943de42778b3db67b..22dfeeb3334586f8f8f35edf6008edc219acded1 100644 (file)
@@ -64,8 +64,8 @@
  *
  * # GtkScale as GtkBuildable
  *
- * `GtkScale` supports a custom <marks> element, which can contain multiple
- * <mark\> elements. The “value” and “position” attributes have the same
+ * `GtkScale` supports a custom `<marks>` element, which can contain multiple
+ * `<mark\>` 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
index 606a4543fecc42e81a402d16f238276ec34b4e32..9c1cd8ca47d11a5be9607e81a699a73a5ec47155 100644 (file)
@@ -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: <ctl><alt>delete
-   * - Two alternative shortcuts: <shift>a Home
-   * - A range of shortcuts: <alt>1...<alt>9
-   * - Several keys pressed together: Control_L&Control_R
-   * - A sequence of shortcuts or keys: <ctl>c+<ctl>x
+   * - A single shortcut: `<ctl><alt>delete`
+   * - Two alternative shortcuts: `<shift>a Home`
+   * - A range of shortcuts: `<alt>1...<alt>9`
+   * - Several keys pressed together: `Control_L&Control_R`
+   * - A sequence of shortcuts or keys: `<ctl>c+<ctl>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 &lt;, &gt; and &amp; when used
+   * Note that `<`, `>` and `&` need to be escaped as `&lt;`, `&gt`; and `&amp`; when used
    * in .ui files.
    */
   properties[PROP_ACCELERATOR] =
index a8b6a27d6c700a6d97956a3781290dfa947f9e31..6dba79ae18cbe76be1c90f8a4ce568995968beef 100644 (file)
  *
  * # GtkSizeGroup as GtkBuildable
  *
- * Size groups can be specified in a UI definition by placing an <object>
+ * Size groups can be specified in a UI definition by placing an `<object>`
  * element with `class="GtkSizeGroup"` somewhere in the UI definition. The
- * widgets that belong to the size group are specified by a <widgets> element
- * that may contain multiple <widget> elements, one for each member of the
+ * widgets that belong to the size group are specified by a `<widgets>` element
+ * that may contain multiple `<widget>` 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`:
index 0f4052e96fc986dce28fcd21394505a42d36f712..ffd3d5c61e90866ccdb3de915b5976aa8916644a 100644 (file)
@@ -38,8 +38,8 @@
  * # GtkStringList as GtkBuildable
  *
  * The `GtkStringList` implementation of the `GtkBuildable` interface
- * supports adding items directly using the <items> element and
- * specifying <item> elements for each item. Each <item> element
+ * supports adding items directly using the `<items>` element and
+ * specifying `<item>` elements for each item. Each `<item>` element
  * supports the regular translation attributes “translatable”,
  * “context” and “comments”.
  *
index 2052d382422a5a95f7840e0b2ff5fd9555cc4d7a..ad7dc95d83cbb398dd7182198101f506db979769 100644 (file)
@@ -50,7 +50,7 @@
  *
  * The `GtkTextTagTable` implementation of the `GtkBuildable` interface
  * supports adding tags by specifying “tag” as the “type” attribute
- * of a <child> element.
+ * of a `<child>` element.
  *
  * An example of a UI definition fragment specifying tags:
  * ```xml
index 88cc0b71abe38b4986922b518351d3f7dc09ec5a..e721aeaa0786b471cefd2cdcf9ef7cd234c03847 100644 (file)
  *
  * 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 <child> element.
+ * attribute of a `<child>` element.
  *
  * # CSS nodes
  *