X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=utils%2Fprepare-configfile.pl;h=59a76913937121f23da83e6d4481f2aca4604c32;hb=bd51cd28a9cc5242ce26bb83398f9d01c310c8f5;hp=f5c9fe2ba1fb9c2fd55ad95ca38ff580b22f77c0;hpb=87085601ca0fa352ecdebbaa37a54400c43ec8c1;p=privoxy.git diff --git a/utils/prepare-configfile.pl b/utils/prepare-configfile.pl index f5c9fe2b..59a76913 100755 --- a/utils/prepare-configfile.pl +++ b/utils/prepare-configfile.pl @@ -31,7 +31,10 @@ sub main() { s/^1\. \@\@TITLE\@\@/ /i; - if (m/^(\d*\.){1,3}\s/) { + if ($hit_header) { + $header_len += length($_); + $_ = " " . $_; + } elsif (m/^(\d*\.){1,3}\s/) { # Remove the first digit as it's the # config file section in the User Manual. s/^(\d\.)//; @@ -42,9 +45,6 @@ sub main() { # Remember to underline it. $hit_header = 1; $header_len = length($_); - - # Separate it from the previous section. - print "#\n"; } if ($unfold_mode) { @@ -53,7 +53,8 @@ sub main() { } else { s/^/# /; } - if ($unfolding_enabled and m/(\s+#)\s*$/) { + if ($unfolding_enabled and + (m/(\s+#)\s*$/ or m/forward-socks5 and$/)) { $unfold_mode = 1; chomp; } @@ -75,12 +76,13 @@ sub main() { print unless (/^\s*$/); - if ($hit_header) { + if ($hit_header and !$unfold_mode) { # The previous line was a section # header so we better underline it. die "Invalid header length" unless defined $header_len; print "# " . "=" x $header_len . "\n"; $hit_header = 0; + $header_len = 0; }; } }