diff options
Diffstat (limited to 'libexec')
-rwxr-xr-x | libexec/filter-github-emails | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libexec/filter-github-emails b/libexec/filter-github-emails index 6f1f3a6..326495d 100755 --- a/libexec/filter-github-emails +++ b/libexec/filter-github-emails | |||
@@ -119,7 +119,19 @@ sub bye { | |||
119 | # | 119 | # |
120 | 120 | ||
121 | sub rewrap { | 121 | sub rewrap { |
122 | my $wrap = sub { /^(?: {4}|\t)/ ? $_ : wrap('', '', $_) }; | 122 | my $wrap = sub { |
123 | my $line = shift; | ||
124 | my $indent; | ||
125 | |||
126 | if ($line =~ /^(?: {4}|\t)/) { | ||
127 | return $line; | ||
128 | } elsif (/^([> ]+)/) { | ||
129 | $indent = $1; | ||
130 | } else { | ||
131 | $indent = ''; | ||
132 | } | ||
133 | return wrap('', $indent, $line); | ||
134 | }; | ||
123 | my @lines = split(/\n/, shift); | 135 | my @lines = split(/\n/, shift); |
124 | my @wrapped = map { $wrap->($_) } @lines; | 136 | my @wrapped = map { $wrap->($_) } @lines; |
125 | 137 | ||