Skip to content

Fix doubled paragraph tags around descriptions

FeRD (Frank Dana) requested to merge ferdnyc/gi-docgen:double-para-tags into main

The templates contained many sections where a description was wrapped in <p>...</p> tags in the template code.

Since the description value already contains <p> tags, this produced invalid HTML like this, from Gtk-4.0/func.test_init.html (note the double open and close tags indicated by the comments):

          <dd class="arg-description">
            <p><em>Type:</em>&nbsp;<code>int*</code></p>
<!-- → -->  <p><p>Address of the <code>argc</code> parameter of the
  <code>main()</code> function. Changed if any arguments were&nbsp;handled.</p></p> <!-- ← -->

Because the descriptions are always one or more paragraphs, remove the extraneous <p>...</p> from the templates. (As well as the unbalanced tags around <p>{{ func.return_value.description|safe }}</td> in function.html, which were definintely invalid HTML.)

When gdgenerate.py uses MISSING_DESCRIPTION for an undefined description value, ensure that it's wrapped in <p>...</p> tags for consistency.

Merge request reports