www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 253] New: Invalid <dl> tag generated by Ddoc

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=253

           Summary: Invalid <dl> tag generated by Ddoc
           Product: D
           Version: 0.162
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ddoc
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jpelcis gmail.com


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.


-- 
Jul 15 2006
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=253


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed dmd 1.032 and 2.016


-- 
Jul 09 2008