Feature Request - Raw HTML in ddoc comments

Bill Baxter dnewsgroup at billbaxter.com
Sat Mar 1 13:18:43 PST 2008


Janice Caron wrote:
> On 01/03/2008, Walter Bright <newshound1 at digitalmars.com> wrote:
>> There's no way to ban it, because ddoc is a text macro processing
>>  program. It does not know what html is.
> 
> The docs explicitly state, and I quote: "HTML can be embedded into the
> documentation comments, and it will be passed through to the HTML
> output unchanged."
> 
> This, to my mind, is a bug - both in the documentation, and in the
> implementation. DMD is at fault here. DMD should /not/ pass HTML
> through unchanged. It should sanitize the input, in order specifically
> to prevent it from being interpreted as markup in the output format.

But DDoc doesn't know anything about the output format.  All it knows is 
some rules for textual transformations based on the macros you give it. 
   It has no way of knowing the full set of sequences have special 
meaning for the chosen output format.

Fixing this by escaping all HTML syntax is not really a fix.  What if I 
type some raw LaTeX in my input?  It'll probably be treated like text 
for HTML output, but be interpreted as code if I output LaTeX.

Like Adam said, the only way to really fix it is to teach DDoc what all 
the special sequences for a given target, and how to escape them.

--bb



More information about the Digitalmars-d mailing list