253 – Invalid <dl> tag generated by Ddoc

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 253 - Invalid <dl> tag generated by Ddoc
Summary: Invalid <dl> tag generated by Ddoc
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P3 normal
Assignee: Walter Bright
URL:
Keywords: ddoc
Depends on:
Blocks:
Reported: 2006年07月15日 16:51 UTC by James Pelcis
Modified: 2014年02月15日 13:20 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description James Pelcis 2006年07月15日 16:51:08 UTC
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 Walter Bright 2008年07月09日 22:31:51 UTC
Fixed dmd 1.032 and 2.016


AltStyle によって変換されたページ (->オリジナル) /