Skip to content

Commit

Permalink
Strip one space in /// comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthaTi committed Nov 25, 2024
1 parent 1039b0e commit 0c09587
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions compiler/src/dmd/lexer.d
Original file line number Diff line number Diff line change
Expand Up @@ -3441,10 +3441,16 @@ class Lexer
if (*q != ct)
break;
}
/* Remove leading line feed
/* Remove leading line feed or space
*/
int linestart = 0;
if (ct != '/' && q < qend)
if (ct == '/')
{
if (q < qend && *q == ' ') {
++q;
}
}
else if (q < qend)
{
if (*q == '\r')
{
Expand Down
4 changes: 2 additions & 2 deletions compiler/test/compilable/extra-files/ddoc14413.html
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ <h4>Declaration</h4>
<div class="ddoc_summary">
<p class="para">
This should
be one
paragraph.
be one
paragraph.

</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/compilable/extra-files/ddoc24871.html
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ <h4>Declaration</h4>
<section class="section ddoc_sections">
<div class="ddoc_summary">
<p class="para">
Example
Example

<section class="code_listing">
<div class="code_sample">
Expand Down

0 comments on commit 0c09587

Please sign in to comment.