dlang / ddox

Advanced D documentation engine
MIT License
63 stars 21 forks source link

Excess `</p><p>` mucking up certain lists' html #144

Closed Abscissa closed 7 years ago

Abscissa commented 7 years ago

This didn't occur before (worked fine in 0.10.8), but sometime after that, some extra <p> and </p> started appearing in certain generated lists, resulting in strange invalid html:

$(UL
    $(LI Fixed: Item 1)
    $(LI Fixed: Item 2)
)

Result

<p><ul> <li>Fixed: Item 1</li>
</p>
<p> <li>Fixed: Item 2</li>
</ul>
</p>

Seems to be related to sections, because removing the colons after "Fixed" makes the excess (and malformed) inner </p>\n<p> go away.

wilzbach commented 7 years ago

Seems related: https://github.com/dlang/phobos/pull/5193

s-ludwig commented 7 years ago

I'm getting this now, so it appears to be resolved:

auto src = "$(UL\n\t$(LI Fixed: Item 1)\n\t$(LI Fixed: Item 2)\n)";
auto dst = "<ul>\t<li>Fixed: Item 1</li>\n\t<li>Fixed: Item 2</li>\n</ul>\n";
assert(formatDdocComment(src) == dst, formatDdocComment(src));
s-ludwig commented 7 years ago

Okay, it just happens outside of the "short description". Will investigate.