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 = /</&lt;/\n
          />/&gt;/\n
          /&/&amp;/\n


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

Reply via email to