{@inheritdoc}

@param string $text

@return string The purged text
518189
public function purge($text)
    {
        if (!$matches = $this->getMatches($text)) {
            return $text;
        }

        return str_replace($matches, '', $text);
    }
1362530
public function processText(string $text): string
    {
        $text = str_replace("<br>", "", $text);
        $text = str_replace("<br/>", "", $text);
        $text = str_replace("<br />", "", $text);
        $text = str_replace("\n", "<br>", $text);
        $text = str_replace("\t", "&nbsp; &nbsp; &nbsp;", $text);

        return preg_replace($this->pattern, $this->replace, $text);
    }
1066274
public function summarizeText(string $text): stdClass
    {
        $summary = $this->requester->post($this->buildUrl(), [
            'sm_api_input' => $text,
        ]);

        return $this->cleanSummary($summary);
    }
211420
protected function reduce(&$text) {
        if (!array_key_exists($this->stack->top(), $this->patterns)) {
            return false;
        }
        if ($text !== '' && ($data = $this->patterns[$this->stack->top()]->split($text)) !== false) {
            list($unmatched, $matched, $text, $childRuleName) = $data;

            return [$unmatched, $matched, $childRuleName];
        }

        return true;
    }
1007413
public function text($text) {

        if(false === is_string($text)) {
            return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($text)), E_USER_ERROR);
        }

    	$this -> text = $text;

    	return $this;
    }
1262539
protected function stripAbbreviations($text) {
	#
	# Strips abbreviations from text, stores titles in hash references.
	#
		$less_than_tab = $this->tab_width - 1;

		# Link defs are in the form: [id]*: url "optional title"
		$text = preg_replace_callback('{
			^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?:	# abbr_id = $1
			(.*)					# text = $2 (no blank lines allowed)	
			}xm',
			array($this, '_stripAbbreviations_callback'),
			$text);
		return $text;
	}
393865
protected function renderText($text)
	{
		if ($this->enableNewlines) {
			return preg_replace("/(  \n|\n)/", "\\\\\\\\\n", $this->escapeLatex($text[1]));
		} else {
			return parent::renderText($text);
		}
	}
519294
public static function ampReplace($text)
    {
        $text = str_replace([
            '&&',
            '&#',
            '&#',
            '&amp;',
            '*-*',
            '*--*',
        ], [
            '*--*',
            '*-*',
            '*-*',
            '&',
            '&#',
            '&&',
        ], $text);

        $text = (string)preg_replace('/|&(?![\w]+;)|/', '&amp;', $text);

        return $text;
    }
345541
public function purify($text)
    {
        $config   = \HTMLPurifier_Config::createDefault();
        $config->set("Cache.DefinitionImpl", null);
        //$config->set('Cache.SerializerPath', '/home/user/absolute/path');

        $purifier = new \HTMLPurifier($config);
    
        return $purifier->purify($text);
    }
1089580
public function replace($text)
    {
        preg_match_all($this->pattern, $text, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
        $delta = 0;
        foreach ($matches as $match)
        {
            $stringsOnly = array();
            foreach ($match as $info)
            {
                $stringsOnly []= $info[0];
            }
            $replace = call_user_func($this->callback, $stringsOnly);
            if (false === $replace || null === $replace)
            {
                continue;
            }

            $text = substr_replace($text, $replace, $match[0][1] + $delta, strlen($match[0][0]));
            $delta += strlen($replace) - strlen($match[0][0]);
        }

        return $text;
    }
1313010
protected function sanitize_text( $text ) {
		// not fancy
		$text = strip_tags( $text );
		$text = esc_html( $text );
		$text = trim( $text );

		return $text;
	}
1164478
protected function removeHtml($text)
    {
        // Remove HTML markup
        $result = strip_tags($text);

        // Decode HTML entities
        $result = trim(html_entity_decode($result, ENT_QUOTES));

        return $result;
    }
711619
static function parse($text)
    {
        $parser = new \Parsedown();

        $text = static::cleanLeadingSpace($text);

        return $parser->text($text);
    }
1022106
public function line( string $text ): string
	{
		$line = $this->lang->item($text, $this->getThen(), $text);
		return is_array($line) ? reset($line) : (string) $line;
	}
149283
function leetify( $text )
    {
        $text = preg_replace( "/to/", "2", $text );
        $text = preg_replace( "/for/", "4", $text );
        $text = preg_replace( "/ate/", "8", $text );
        $text = preg_replace( "/you/", "u", $text );
        $text = preg_replace( array( "/l/",
                                     "/e/",
                                     "/o/",
                                     "/a/",
                                     "/t/" ),
                              array( "1",
                                     "3",
                                     "0",
                                     "4",
                                     "7" ), $text );
        return $text;
    }
362733
private function normalizeText($text): string
    {
/* @TODO: try to resolve at a later date; Twig's `| raw` just returns a string, not `Markup` so we can't use that as a check
        if ($text instanceof Markup) {
            // Either came from a Redactor field (or the like) or they manually added a |raw tag. We can trust it
            $text = (string)$text;
        } else {
            // We don't trust it, so escape any HTML
            $twig = Craft::$app->view->twig;
            try {
                $text = twig_escape_filter($twig, $text);
            } catch (\Twig_Error_Runtime $e) {
                $error = $e->getMessage();
                Craft::error($error, __METHOD__);
                // We don't want unescaped text slipping through, so set the text to the error message
                $text = $error;
            }
        }
*/
        // If it's null or otherwise empty, just return an empty string
        if (empty($text)) {
            $text = '';
        }
        $text = (string)$text;

        $settings = Typogrify::$plugin->getSettings();

        if ($settings['default_escape'] === true) {
            $twig = Craft::$app->view->twig;
            $text = twig_escape_filter($twig, $text);
        }

        return $text;
    }
59058
protected function replaceInText($text)
	{
		$text = str_replace("##YEAR##", date('Y'), $text);
		$text = str_replace("##DATE##", date('Y-m-d'), $text);

		return $text;
	}