From 3709ecb9296d3ce08fbfc94a073544aefd33fa66 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Fri, 3 Jun 2011 18:34:32 +0200 Subject: [PATCH] MDL-27736 improve a bit html2text to avoid some ugly & unnecessary trailing spaces --- lib/html2text.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/html2text.php b/lib/html2text.php index 8d143bfb297..e2d0dffddbc 100644 --- a/lib/html2text.php +++ b/lib/html2text.php @@ -169,6 +169,7 @@ class html2text '/&(bull|#149|#8226);/i', // Bullet '/&(pound|#163);/i', // Pound sign '/&(euro|#8364);/i', // Euro sign + '/[ ]+([\n\t])/', // Trailing spaces before newline or tab '/[ ]{2,}/' // Runs of spaces, post-handling ); @@ -212,6 +213,7 @@ class html2text '*', '£', 'EUR', // Euro sign. € ? + '\\1', // Trailing spaces before newline or tab ' ' // Runs of spaces, post-handling );