]> gitweb.ps.run Git - ps-gitweb/commitdiff
escape \s in double quotes
authorpatrick-scho <patrick.schoenberger@posteo.de>
Sat, 29 Nov 2025 14:07:10 +0000 (15:07 +0100)
committerpatrick-scho <patrick.schoenberger@posteo.de>
Sat, 29 Nov 2025 14:07:10 +0000 (15:07 +0100)
gitweb/gitweb.perl

index a1c838d4ca14240392b7443632ccee627f336147..07e535921d57dfaffab11b3adcfe63701019ddc2 100755 (executable)
@@ -7231,7 +7231,7 @@ sub get_markdown {
    my $thash = shift;
    my $rethtmlstr = "";
    use open ":encoding(utf8)"; # needed to have utf8 survive through the shell pipe
-   my $cmd_markdownify = $GIT . " " . git_cmd() . " cat-file blob " . $thash . " | " . $PERL . " -e 'my \$str = do { local \$/; <STDIN> }; \$str =~ s/<!--.*?--\s*>//gs; print \$str;' | " . $MD . " |";
+   my $cmd_markdownify = $GIT . " " . git_cmd() . " cat-file blob " . $thash . " | " . $PERL . " -e 'my \$str = do { local \$/; <STDIN> }; \$str =~ s/<!--.*?--\\s*>//gs; print \$str;' | " . $MD . " |";
    open (FOO, $cmd_markdownify) or die_error(500, "Open git-cat-file blob '$thash' failed");
    while (<FOO>) {
        if ($_ =~ /(<img[^>]src=")(.*?)"/) {