mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 17:24:46 +02:00
Fix issue processwire/processwire-issues#1015
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user