[Rt-commit] rt branch, 5.0/fix-html-to-plaintext-conversion-to-preserve-quoting, repushed
Dianne Skoll
dianne at bestpractical.com
Tue Aug 11 16:55:12 EDT 2020
The branch 5.0/fix-html-to-plaintext-conversion-to-preserve-quoting was deleted and repushed:
was 6ac1190929ae21ce5bdda3e1b0cc2d6bf4ccbc06
now aacd9e9249146a4e53a27ea93af5fd7f23e1e01d
1: 6ac1190929 ! 1: aacd9e9249 Preserve quoting levels when converting HTML to plain text
@@ -1,6 +1,6 @@
Author: Dianne Skoll <dianne at bestpractical.com>
- Ticket #224369: Preserve quoting levels when converting HTML to plain text
+ Preserve quoting levels when converting HTML to plain text
When you reply to a message in RT using the rich text editor, RT creates
a text/plain version corresponding to the text/html version. However,
@@ -25,7 +25,7 @@
+# Hash describing how various formatters format <blockquote>...</blockquote>
+# regions.
-+my $BlockquoteDescriptor = {
++our $BlockquoteDescriptor = {
+ w3m => { indent => 4},
+ elinks => { indent => 2},
+ links => { indent => 2},
@@ -44,11 +44,8 @@
+ my ($text, $converter) = @_;
+
+ return $text unless exists($BlockquoteDescriptor->{$converter});
-+ my $desc = $BlockquoteDescriptor->{$converter};
-+ my $spaces;
-+
-+ my $n = $desc->{indent};
-+ $spaces = ' ' x $n;
++ my $n = $BlockquoteDescriptor->{$converter}{indent};
++ my $spaces = ' ' x $n;
+
+ # Convert each level of indentation to a ">"; add a space aferwards
+ # for readability
@@ -173,21 +170,11 @@
+Back to top-level
+EOF
+
-+sub prog_on_path
-+{
-+ my ($prog) = @_;
-+ return 1 if $prog eq 'core';
-+ foreach my $dir (split(/:/, $ENV{PATH})) {
-+ return 1 if -x "$dir/$prog";
-+ }
-+ return 0;
-+}
-+
+sub test_conversion
+{
+ my ($converter, $expected) = @_;
+ SKIP: {
-+ if (!prog_on_path($converter)) {
++ if ($converter ne 'core' && !RT::Test->find_executable($converter)) {
+ skip "Skipping $converter: Not installed", 1;
+ return;
+ }
More information about the rt-commit
mailing list