dlangspec.pdf?

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Jan 7 10:06:04 PST 2013


On Mon, Jan 07, 2013 at 06:40:36PM +0100, Adam D. Ruppe wrote:
> On Monday, 7 January 2013 at 17:32:33 UTC, H. S. Teoh wrote:
> >I think the simplest way would be to allow the definition of some
> >kind of post-processing filter that escapes LaTeX
> >metacharacters with their appropriate substitutions.
> 
> Believe it or not, but dmd already has the beginnings of this code!
> There's a ddoc escapes table.
> 
> from doc.c:
> 
> ESCAPES = /</</\n
>           />/>/\n
>           /&/&/\n

This is exactly what's needed to produce proper LaTeX output.


> And there's code to parse it, but it isn't actually used. I did a
> dmd pull request a while ago to bring in this functionality but it
> didn't pass reviews. (A consequence of proper escaping would be that
> inline HTML, outside of macros, would no longer be permitted,
> because <b> etc would be properly escaped instead of printed out
> verbatim. This is far, far, far superior to the status quo, but it
> does break a lot of phobos documentation.)

Inline HTML should not be allowed in ddoc, because it completely defeats
the purpose of the ddoc macro system allowing the same documentation to
be rendered for multiple target formats.

We need to go through all instances of such errors in Phobos and fix 'em
all.


T

-- 
Don't get stuck in a closet---wear yourself out.


More information about the Digitalmars-d mailing list