Is run.d going to be expand for runtime and the phobos library?

Adam D. Ruppe destructionator at gmail.com
Mon Jun 15 17:09:16 UTC 2020


On Saturday, 13 June 2020 at 18:30:31 UTC, Andrei Alexandrescu 
wrote:
> Yah that's awful. At a point either myself or someone else was 
> working on automatically inserting a $(P ...) whenever a double 
> newline was present. I think that was an easy fix.

Indeed, and ddoc actually kinda does that for .d files, it just 
doesn't for .dd files. Weird rules.

But \n\n is not necessarily a paragraph break. Consider this:

/++

First paragraph

$(DIVC foo,
   bar
)
+/

That \n\n there is immediately followed by a div tag... and 
should not actually have a <p> before it. It isn't completely 
wrong but it isn't right semantically and can lead to spacing 
bugs in the resulting page (it is invalid html to have a div 
inside a p, so it will automatically close the <p> tag before 
opening the <div>).

So it is just a bit more complicated than it looks. My 
implementation to cover all the crazy edge cases I thought up is 
like 300 lines of code and it still isn't actually perfect (of 
course any time you have a 300 line buggy function there's the 
possibility that I just overcomplicated it and there's a much 
simpler, more general solution I missed).


More information about the Digitalmars-d mailing list