New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 9731: implement $(DDOC_PARAGRAPH) #4338
Conversation
Neither should they appear inside code blocks.
Ah, this is awesome! Thanks! I see a paragraph break is consider |
Thinking about it a bit more I guess it's fine if we leave other whitespace be. I'd say any run of |
Actually, that's what this PR does right now: any runs of IOW:
produces multiple instances of The idea is that if |
Issue 9731: implement $(DDOC_PARAGRAPH)
@quickfur waiting for your comeback! |
What, exactly, breaks in the pdf build? This code in property.dd looks wrong to me:
The code example isn't actually in the Now, going for generating purely valid html might not be something ddoc can handle with its simple automation, but we should try to do it and part of that would be moving the code example to reside inside the BTW we might also set it so the tag is not written out for empty paragraphs. I'm just looking at the code here but I think it currently might output empty tags. |
Fixes: https://issues.dlang.org/show_bug.cgi?id=9731
Basically, this will wrap text within ddoc comments into proper paragraphs (via a new macro
DDOC_PARAGRAPH
) so that ddoc output can produce correctly-nested paragraph tags in strict output formats like XHTML or DOCBOOK.For backward compatibility,
DDOC_PARAGRAPH
defaults to just$0
, andDDOC_BLANKLINE
retains its old behaviour. The expected usage pattern, however, is to defineDDOC_BLANKLINE
andBR
to be blank, andDDOC_PARAGRAPH
to be<p>$0</p>
(or equivalent).The testcase uses contrived tags for
DDOC_PARAGRAPH
andBR
in order to verify that the generated paragraph tags came fromDDOC_PARAGRAPH
(not something else that expands to<p>
), and that the$(BR)
macros are generated in backward-compatible locations.