system/View/Parser.php
protected function prepareReplacement(array $matches, string $replace, bool $escape = true): string
	{
		$orig = array_shift($matches);

		// Our regex earlier will leave all chained values on a single line
		// so we need to break them apart so we can apply them all.
		$filters = isset($matches[0]) ? explode('|', $matches[0]) : [];

		if ($escape && ! isset($matches[0]))
		{
			if ($context = $this->shouldAddEscaping($orig))
			{
				$filters[] = "esc({$context})";
			}
		}

		$replace = $this->applyFilters($replace, $filters);

		return $replace;
	}
protected function prepareReplacement(array $matches, string $replace, bool $escape = true): string
	{
		$orig = array_shift($matches);

		// Our regex earlier will leave all chained values on a single line
		// so we need to break them apart so we can apply them all.
		$filters = isset($matches[0]) ? explode('|', $matches[0]) : [];

		if ($escape && ! isset($matches[0]))
		{
			if ($context = $this->shouldAddEscaping($orig))
			{
				$filters[] = "esc({$context})";
			}
		}

		$replace = $this->applyFilters($replace, $filters);

		return $replace;
	}
Callback used during parse() to apply any filters to the value.

@param array   $matches
@param string  $replace
@param boolean $escape

@return string