Consider this example file with line comment documentation that contains a code snippet: ```d import std.stdio; /// Example /// --- /// void main() { /// foreach (i; 0..10) { /// writeln("Hello, world!"); /// } /// } /// --- void main() { writeln("Hello, World!"); } ``` When rendered using `dmd -D`, the indent in the snippet is gone: ```d <pre><code class="code"><span class="keyword">void</span> <span class="psymbol">main</span>() { <span class="keyword">foreach</span> (i; 0..10) { writeln(<span class="string_literal">"Hello, world!"</span>); } } </code></pre> This is not the case if block comments are used. ```
@ArthaTi created dlang/dmd pull request #17082 "Fix bugzilla issue 24871 - DDoc strips indent in triple slash comments" fixing this issue: - Fix bugzilla issue 24871 - DDoc strips indent in triple slash comments Removes code in the lexer responsible for removing leading spaces in triple slash doc comments. This affects the test file for issue 14413; two more spaces appear, but they are not significant in the HTML output. https://github.com/dlang/dmd/pull/17082
dlang/dmd pull request #17082 "Fix bugzilla issue 24871 - DDoc strips indent in triple slash comments" was merged into master: - 303d95f680b6533885f28b6ec1651c0fe4e4a905 by Artha: Fix bugzilla issue 24871 - DDoc strips indent in triple slash comments Removes code in the lexer responsible for removing leading spaces in triple slash doc comments. This affects the test file for issue 14413; two more spaces appear, but they are not significant in the HTML output. https://github.com/dlang/dmd/pull/17082