Skip to content

MLR105: MarkupText literal contains provably invalid Pango markup

qual reports MLR105 when a literal passed to MarkupText contains an error inside the validated Pango subset: mismatched, stray, or unclosed convenience tags (b i u s sub sup tt big small and span with quoted attributes), or an unknown entity (&xyz; outside & < > " ' and numeric &#...;).

  • Default severity: error
  • Minimum confidence: high
  • Implementation phase: 1
  • Fix: unsafe suggestion appending the missing closing tag

Any construct outside the validated subset (for example Manim's <gradient> extension tag, unknown tags, or a bare <) makes the whole literal Unknown and the rule stays silent — a general XML parser's accept/reject is never equated with Pango.

Wrong:

MarkupText("<b>bold</i>")     # closes the wrong tag: Pango error
MarkupText("<u>never closed")

Right:

MarkupText("<b>bold</b>")
MarkupText("<gradient from='RED' to='BLUE'>x</gradient>")  # outside subset