Bug 253 – Invalid <dl> tag generated by Ddoc

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-07-15T16:51:00Z
Last change time
2014-02-15T13:20:07Z
Keywords
ddoc
Assigned to
bugzilla
Creator
jpelcis

Comments

Comment #0 by jpelcis — 2006-07-15T16:51:08Z
I was making the default Ddoc generation work with XHTML 1.1 when I ran into a little problem. The version I have now is available at http://www.summerseas.com/jpelcis/downloads/test.ddoc. It seems to generate almost completely correct code, even if the result currently looks slightly different (it's a WIP). There is, however, one thing I can't seem to fix with the way Ddoc currently works. If a struct is specified but no elements are provided, Ddoc will output a <dl></dl>, which is invalid without a child element. -------------------------------- /** Generates proper XHTML. */ struct bar { int blah; /// } -------------------------------- /** Generates improper XHTML. */ struct foo { int blah; } -------------------------------- This is the line that appears to be causing the problem. DDOC_MEMBERS = $(DL $0) -------------------------------- There are some other ways to force improper code generation, too (Params: with no parameters specified), but most others seem to be errors on the part of the code writer. -------------------------------- There are two possible solution I see: Specific: Only generate a DDOC_MODULE_MEMBERS if some members have documentation associated with them. This would likely be relatively easy to implement, but some future problems might be missed. -------------------------------- General: Create a macro that uses, say, $- (since we have a $+) to represent a non-empty string. The downside is that there would have to be some sort of "macro overloading," which appears to be beyond the scope of Ddoc.
Comment #1 by bugzilla — 2008-07-09T22:31:51Z
Fixed dmd 1.032 and 2.016