From 195bc894c1a3a892ff1d006301d75fcae0e04e3c Mon Sep 17 00:00:00 2001 From: seb303 Date: Tue, 20 Feb 2024 10:46:13 +0000 Subject: [PATCH 1/5] Added option 'plain_text' If true then disables various pseudo formatting: No converting bold, th or headings to upper case. No character conversion to simulate strike through for No adding _ around italic text ( and tags)
is replaced by "\n\n" rather than "\n-------------------------\n" --- src/Html2Text.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/src/Html2Text.php b/src/Html2Text.php index 16a6572..7297013 100644 --- a/src/Html2Text.php +++ b/src/Html2Text.php @@ -102,6 +102,38 @@ class Html2Text '[\\2]', // with alt tag ); + /** + * List of pattern replacements corresponding to patterns searched. + * Used with 'plain_text' option. + * + * @var array $replace + * @see $search + */ + protected $replace_plain = array( + '', // Non-legal carriage return + ' ', // Newlines and tabs + '', // + '', //