Skip to content

Blank lines between table row elements inserts empty paragraphs within table heading and data elements #11897

@ermingol23

Description

@ermingol23

Describe the bug
When I add a table to a documentation block like this

 * <table>
 * <caption id=fnord>My caption</caption>
 * <tr><th>Column</th></tr>
 * <tr><td>Row</td></tr>
 * </table>

the resulting HTML fragment is as expected like this

<table class="doxtable">
<caption>My caption</caption>
<tr>
<th>Column </th></tr>
<tr>
<td>Row </td></tr>
</table>

If I add "blank lines" like this

 * <table>
 * <caption id=fnord>My caption</caption>
 * <tr><th>Column</th></tr>
 *
 * <tr><td>Row</td></tr>
 *
 * </table>

the resulting HTML looks like this instead

<table class="doxtable">
<caption>My caption</caption>
<tr>
<th><p class="starttd">Column</p>
<p class="endtd"></p>
</th></tr>
<tr>
<td><p class="starttd">Row</p>
<p class="endtd"></p>
</td></tr>
</table>

Empty paragraphs with CSS classes starttd and endtd have been inserted within th and td elements as well as wrapping the cell content within a paragraph with CSS styling which might affect the visual appearance of the rendered table and its cells in the browser.

Screenshots

To Reproduce

Expected behavior
No empty paragraphs should be added to the th and/or td elements when the blank lines are outside of the th and td elements in the HTML table.

 * <table>
 * <caption id=fnord>My caption</caption>
 * <tr><th>Column</th></tr>
 *
 * <tr><td>Row</td></tr>
 *
 * </table>

should result in

<table class="doxtable">
<caption>My caption</caption>
<tr>
<th>Column </th></tr>
<tr>
<td>Row </td></tr>
</table>

Version
Doxygen version: 1.9.1 (yes it is old, but it is the default version for Ubuntu 22.04 LTS; note that it is of course ok if any correction is implemented in the latest version of Doxygen)

lsb_release -a gives
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy

Stack trace
N/A

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    solved in the mean timeBug solved in a previous version, to be confirmed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions