Feature Request - Raw HTML in ddoc comments

Janice Caron caron800 at googlemail.com
Sat Mar 1 13:45:51 PST 2008


On 01/03/2008, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
> 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.

I didn't say the ddoc format was at fault, I said DMD was at fault.

It is the translation tool which is at fault. A tool which translates
DDOC into HTML must, by definition, know about HTML - just as a tool
which translates DDOC into PDF must know about PDF.

In this case, the translation tool happens to be DMD.


>  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.

The correct behavior would be for any DDOC->HTML translation tool to
escape HTML, and for any DDOC->LaTeX translation tool to escape LaTeX.
This has nothing whatsoever to do with DDOC format. The problem is in
the translation tools.

To make an analogy, if I write a tool that translates any source
format into XML,then I **MUST** escape anything < and & and ", because
otherwise the resulting document will not be well formed, and will be
invalid. This will not have been the fault of the source format, it
will have been a bug in my application!


>  Like Adam said, the only way to really fix it is to teach DDoc

I don't understand what you mean here. So far as I am aware, DDOC is a
markup language, not an application. It is therefore not possible to
"teach" it anything. I say, leave DDOC alone - just do a better job of
translating it.



More information about the Digitalmars-d mailing list