October 07, 2023
https://issues.dlang.org/show_bug.cgi?id=24179

          Issue ID: 24179
           Summary: Ddoc broke D code sections
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: bugzilla@digitalmars.com

Consider:
----------
Ddoc

$(D_CODE
int a;
int b;
)
-----------
Compile with:

dmd -c test.dd

which creates a test.html file. Rendering the html file gives:

------------
1. int a; int b;
------------

I presume this is intended:

-------------
1. int a;
2. int b;
-------------

Looking at the html generated:

-------------
<section class="code_listing">
  <div class="code_sample">
    <div class="dlang">
      <ol class="code_lines">
        <li><code class="code">int a;
int b;
</code></li>
      </ol>
    </div>
  </div>
</section>
--------------

and the line break in the code is not respected. This used to work, at least back in version 2.063 the D code blocks rendered correctly.

What happened?

The 2.073 compiler would generate:

---------------
<pre class="d_code"><span class="d_keyword">int</span> a;
<span class="d_keyword">int</span> b;
</pre>
---------------

--