diff --git a/crates/mdman/src/hbs.rs b/crates/mdman/src/hbs.rs index 09726b83ce7..ca739900cf0 100644 --- a/crates/mdman/src/hbs.rs +++ b/crates/mdman/src/hbs.rs @@ -139,6 +139,9 @@ impl HelperDef for OptionHelper<'_> { // Render the block. let block = t.renders(r, gctx, rc)?; + // Windows newlines can break some rendering, so normalize. + let block = block.replace("\r\n", "\n"); + // Get the name of this page. let man_name = gctx .data() diff --git a/crates/mdman/tests/compare/expected/options.1 b/crates/mdman/tests/compare/expected/options.1 index d362421e9f0..02ba1eb66bc 100644 --- a/crates/mdman/tests/compare/expected/options.1 +++ b/crates/mdman/tests/compare/expected/options.1 @@ -69,6 +69,11 @@ Flag with optional value. .RS 4 Alternate syntax for optional value (with required = for disambiguation). .RE +.sp +\fB\-\-split\-block\fR +.RS 4 +An option where the description has a \fBblock statement that is split across multiple lines\fR +.RE .SH "EXAMPLES" .sp .RS 4 diff --git a/crates/mdman/tests/compare/expected/options.md b/crates/mdman/tests/compare/expected/options.md index 19b0b443b64..0178cac2d7c 100644 --- a/crates/mdman/tests/compare/expected/options.md +++ b/crates/mdman/tests/compare/expected/options.md @@ -58,6 +58,10 @@ A description of the command.
Alternate syntax for optional value (with required = for disambiguation).
+
--split-block
+
An option where the description has a block statement that is split across multiple lines
+ + diff --git a/crates/mdman/tests/compare/expected/options.txt b/crates/mdman/tests/compare/expected/options.txt index 9bfdec67c95..f585cba466a 100644 --- a/crates/mdman/tests/compare/expected/options.txt +++ b/crates/mdman/tests/compare/expected/options.txt @@ -43,6 +43,10 @@ OPTIONS Alternate syntax for optional value (with required = for disambiguation). + --split-block + An option where the description has a block statement that is split + across multiple lines + EXAMPLES 1. An example diff --git a/crates/mdman/tests/compare/includes/options-common.md b/crates/mdman/tests/compare/includes/options-common.md index 07404e3f74c..56f727a10cb 100644 --- a/crates/mdman/tests/compare/includes/options-common.md +++ b/crates/mdman/tests/compare/includes/options-common.md @@ -11,4 +11,9 @@ Flag with optional value. Alternate syntax for optional value (with required = for disambiguation). {{/option}} +{{#option "`--split-block`"}} +An option where the description has a `block statement +that is split across multiple lines` +{{/option}} + {{/options}}