]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
managen: accept more markdown-quote-markers
authorDaniel Stenberg <daniel@haxx.se>
Wed, 12 Mar 2025 12:09:30 +0000 (13:09 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 12 Mar 2025 13:36:11 +0000 (14:36 +0100)
Lines starting with ``` or ~~~ indicate start and end of a quoted
section.

Closes #16685

scripts/managen

index 6621b1684c0203148a8d47a0167b8f6a7ffdce99..5e03180144b722f844030655a45ba0a52cf0479e 100755 (executable)
@@ -320,7 +320,23 @@ sub render {
             $quote = 1;
             $d = "$word\n";
         }
-        elsif($quote) {
+        elsif($d =~ /^(```|~~~)/) {
+            if(!$quote) {
+                if($manpage) {
+                    push @desc, "\n" if($blankline);
+                    push @desc, ".nf\n";
+                    $blankline = 0;
+                }
+                $quote = 2;
+            }
+            else {
+                # end of quote
+                push @desc, ".fi\n" if($manpage);
+                $quote = 0;
+            }
+            next;
+        }
+        elsif($quote == 1) {
             # end of quote
             push @desc, ".fi\n" if($manpage);
             $quote = 0;