From ceca16506ac4044bc08948ac39f2a95c62c0daf9 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 5 Nov 2019 08:55:36 -0500 Subject: [PATCH] Fix issue processwire/processwire-issues#1015 --- wire/core/WireTextTools.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wire/core/WireTextTools.php b/wire/core/WireTextTools.php index a22ace28..27372bad 100644 --- a/wire/core/WireTextTools.php +++ b/wire/core/WireTextTools.php @@ -323,6 +323,7 @@ class WireTextTools extends Wire { * - `stripTags` (bool): Strip markup tags? (default=true) * - `keepTags` (array): Array of tag names to keep, if stripTags==true. (default=[]) * - `collapseLinesWith` (string): String to collapse newlines with. (default=' ') + * - `linksToUrls` (bool): Convert links to "(url)" rather than removing entirely? (default=false) Since 3.0.132 * - `endBlocksWith` (string): Character or string to insert to identify paragraph/header separation (default='') * - `convertEntities` (bool): Convert entity-encoded characters to text? (default=true) * @return mixed|string @@ -336,13 +337,17 @@ class WireTextTools extends Wire { 'collapseLinesWith' => ' ', 'endBlocksWith' => '', 'convertEntities' => true, + 'linksToUrls' => false, ); $options = array_merge($defaults, $options); if($options['stripTags']) { $str = $this->markupToText($str, array( + 'underlineHeadlines' => false, + 'uppercaseHeadlines' => false, 'convertEntities' => $options['convertEntities'], + 'linksToUrls' => $options['linksToUrls'], 'keepTags' => $options['keepTags'], )); if(!strlen($str)) return $str;