mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 17:54:44 +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)
|
* - `stripTags` (bool): Strip markup tags? (default=true)
|
||||||
* - `keepTags` (array): Array of tag names to keep, if stripTags==true. (default=[])
|
* - `keepTags` (array): Array of tag names to keep, if stripTags==true. (default=[])
|
||||||
* - `collapseLinesWith` (string): String to collapse newlines with. (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='')
|
* - `endBlocksWith` (string): Character or string to insert to identify paragraph/header separation (default='')
|
||||||
* - `convertEntities` (bool): Convert entity-encoded characters to text? (default=true)
|
* - `convertEntities` (bool): Convert entity-encoded characters to text? (default=true)
|
||||||
* @return mixed|string
|
* @return mixed|string
|
||||||
@@ -336,13 +337,17 @@ class WireTextTools extends Wire {
|
|||||||
'collapseLinesWith' => ' ',
|
'collapseLinesWith' => ' ',
|
||||||
'endBlocksWith' => '',
|
'endBlocksWith' => '',
|
||||||
'convertEntities' => true,
|
'convertEntities' => true,
|
||||||
|
'linksToUrls' => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
$options = array_merge($defaults, $options);
|
$options = array_merge($defaults, $options);
|
||||||
|
|
||||||
if($options['stripTags']) {
|
if($options['stripTags']) {
|
||||||
$str = $this->markupToText($str, array(
|
$str = $this->markupToText($str, array(
|
||||||
|
'underlineHeadlines' => false,
|
||||||
|
'uppercaseHeadlines' => false,
|
||||||
'convertEntities' => $options['convertEntities'],
|
'convertEntities' => $options['convertEntities'],
|
||||||
|
'linksToUrls' => $options['linksToUrls'],
|
||||||
'keepTags' => $options['keepTags'],
|
'keepTags' => $options['keepTags'],
|
||||||
));
|
));
|
||||||
if(!strlen($str)) return $str;
|
if(!strlen($str)) return $str;
|
||||||
|
Reference in New Issue
Block a user