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\.)//;
s/^\s+/ /;
$unfold_mode = 0;
} else {
+ if ( $hit_option ) {
+ # processing a continuation of a @@ line
+ if ( /^\s*$/ ) { # blank line
+ $hit_option = 0;
+ next;
+ }
+ }
s/^/# /;
}
- if ($unfolding_enabled and m/(\s+#)\s*$/) {
+ if ($unfolding_enabled and
+ (m/(\s+#)\s*$/ or m/forward-socks5 and$/)) {
$unfold_mode = 1;
chomp;
}
# XXX: someone should figure out what this stuff
# is supposed to do (and if it really does that).
s/^# #/####/ if /^# #{12,}/;
- s/^.*$// if $hit_option;
- $hit_option = 0;
s/^\n//;
s/^#\s*-{20,}//;
s/ *$//;
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;
};
}
}