[Rt-commit] rt branch, 5.0/warn-html-formatter, created. rt-5.0.0beta1-43-g0fff95b5da

Jim Brandt jbrandt at bestpractical.com
Mon Jul 6 14:31:17 EDT 2020

The branch, 5.0/warn-html-formatter has been created
        at  0fff95b5da6587d2018c368a6e843b984f886aa6 (commit)

- Log -----------------------------------------------------------------
commit 0fff95b5da6587d2018c368a6e843b984f886aa6
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Jul 6 14:18:14 2020 -0400

    Document and log information on external HTML formatters
    Performance issues processing HTML from email has become a
    more common support request, likely because most email now is
    HTML. Switching to an external formatter seems to almost always
    resolve the issue, so make it easier to find this information.

diff --git a/README b/README
index 5692d86d5c..e21ed0b6fe 100644
--- a/README
+++ b/README
@@ -45,6 +45,18 @@ o   Various and sundry perl modules
         of the modules required, and you may be better off installing
         the modules that way.
+o   Full-text indexing support in your database
+        The databases listed above all have options for full-text indexing
+        (excluding SQLite). See docs/full_text_indexing.pod for details.
+o   An external HTML converter
+        Installing an external utility to convert HTML can improve performance.
+        See the $HTMLFormatter configuration option for details.
diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index a0e2f0d9e5..ac7138473d 100644
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -1469,17 +1469,19 @@ sub _HTMLFormatter {
     return $formatter if defined $formatter;
     my $wanted = RT->Config->Get("HTMLFormatter");
+    my @options = ("w3m", "elinks", "links", "html2text", "lynx", "core");
     my @order;
     if ($wanted) {
         @order = ($wanted, "core");
     } else {
-        @order = ("w3m", "elinks", "links", "html2text", "lynx", "core");
+        @order = @options;
     # Always fall back to core, even if it is not listed
     for my $prog (@order) {
         if ($prog eq "core") {
             RT->Logger->debug("Using internal Perl HTML -> text conversion");
+            RT->Logger->warn("Running with the internal HTML converter can result in performance issues with some HTML. Install one of the following utilities with your package manager to improve performance with an external tool: " . join (', ', @options));
             require HTML::FormatText::WithLinks::AndTables;
             $formatter = \&_HTMLFormatText;
         } else {


More information about the rt-commit mailing list