Currently, ddoc does not have a direct way of identifying paragraphs in ddoc comments. The only thing support right now is $(DDOC_BLANKLINE), which defaults to <br><br>. This (more-or-less) works for HTML output, but it doesn't work so well for more semantically-driven output formats that want to know paragraph boundaries explicitly.
There is a way to hack this to work in HTML by defining DDOC_BLANKLINE=</p><p> and DDOC_SECTION=<p>$0</p>, but this doesn't work if you define DDOC_SECTION_H=<h4>$0</h4>, because then the h4 is nested inside the p, which is non-compliant.
Basically, there is no way to correctly support correct element nesting in HTML (or other strictly-nested formats like DocBook) without post-processing (e.g., set DDOC_BLANKLINE to some marker string that gets substituted by an external tool with suitable open/close tags depending on the surrounding context).
It would be nice if ddoc could output macros based on paragraph boundaries rather than linebreaks, say $(DDOC_PARAGRAPH) or something similar, so that translation into other formats than HTML 4.x is easier.
Comment #1 by hsteoh — 2014-12-31T00:40:44Z
Andrei proposed on the forum a backward-compatible fix, wherein $(DDOC_BLANKLINE) continues to be emitted, but paragraphs are also wrapped in a paragraph macro.