Skip to content

Commit 8e2a37c

Browse files
committed
[mdman] Normalize newlines when rendering options
1 parent a250d27 commit 8e2a37c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

crates/mdman/src/hbs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ impl HelperDef for OptionHelper<'_> {
139139
// Render the block.
140140
let block = t.renders(r, gctx, rc)?;
141141

142+
// Windows newlines can break some rendering, so normalize.
143+
let block = block.replace("\r\n", "\n");
144+
142145
// Get the name of this page.
143146
let man_name = gctx
144147
.data()

crates/mdman/tests/compare/expected/options.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Alternate syntax for optional value (with required = for disambiguation).
7272
.sp
7373
\fB\-\-split\-block\fR
7474
.RS 4
75-
An option where the description has a \fBblock statement that is split across multiple lines\fR
75+
An option where the description has a \fBblock statement that is split across multiple lines\fR
7676
.RE
7777
.SH "EXAMPLES"
7878
.sp

crates/mdman/tests/compare/expected/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ A description of the command.
5959

6060

6161
<dt class="option-term" id="option-options---split-block"><a class="option-anchor" href="#option-options---split-block"></a><code>--split-block</code></dt>
62-
<dd class="option-desc">An option where the description has a <code>block statement that is split across multiple lines</code></dd>
62+
<dd class="option-desc">An option where the description has a <code>block statement that is split across multiple lines</code></dd>
6363

6464

6565
</dl>

0 commit comments

Comments
 (0)