Closed nbCloud91 closed 1 year ago
The reserved characters (<>&
...) in SGML-like language (Pango, HTML...) should be escaped to be parsed correctly, so the culprit is &
in line 100:
Color \Col"or\, v. t. [imp. & p. p. {Colored}; p. pr. & vb. n.
const { Pango, GLib } = imports.gi;
let s = 'Color \\Col"or\\, v. t. [imp. & p. p. {Colored}; p. pr. & vb. n.';
Pango.parse_markup(s, -1, ''); // error
Pango.parse_markup(GLib.markup_escape_text(s, -1), -1, ''); // ok
See also https://docs.rs/html2pango/latest/html2pango/#escaping and https://gjs-docs.gnome.org/glib20~2.0/glib.markup_escape_text.
Thank you!
I do not know the exact threshold of when this happens but pango markup does not get rendered when the text is too big. Below are two examples:
Background
Background \Back"ground`\, n. [Back, a. + ground.]
Ground in the rear or behind, or in the distance, as opposed to the foreground, or the ground in front.
(Paint.) The space which is behind and subordinate to a portrait or group of figures.
Note: The distance in a picture is usually divided into foreground, middle distance, and background. --Fairholt.
Anything behind, serving as a foil; as, the statue had a background of red hangings.
A place in obscurity or retirement, or out of sight.
which is rendered as: