public function shouldAddEscaping(string $key)
	{
		$escape = false;

		$key = trim(str_replace(['{', '}'], '', $key));

		// If the key has a context stored (from setData)
		// we need to respect that.
		if (array_key_exists($key, $this->dataContexts))
		{
			if ($this->dataContexts[$key] !== 'raw')
			{
				return $this->dataContexts[$key];
			}
		}
		// No pipes, then we know we need to escape
		elseif (strpos($key, '|') === false)
		{
			$escape = 'html';
		}
		// If there's a `noescape` then we're definitely false.
		elseif (strpos($key, 'noescape') !== false)
		{
			$escape = false;
		}
		// If no `esc` filter is found, then we'll need to add one.
		elseif (! preg_match('/\s+esc/', $key))
		{
			$escape = 'html';
		}

		return $escape;
	}
public function shouldAddEscaping(string $key)
	{
		$escape = false;

		$key = trim(str_replace(['{', '}'], '', $key));

		// If the key has a context stored (from setData)
		// we need to respect that.
		if (array_key_exists($key, $this->dataContexts))
		{
			if ($this->dataContexts[$key] !== 'raw')
			{
				return $this->dataContexts[$key];
			}
		}
		// No pipes, then we know we need to escape
		elseif (strpos($key, '|') === false)
		{
			$escape = 'html';
		}
		// If there's a `noescape` then we're definitely false.
		elseif (strpos($key, 'noescape') !== false)
		{
			$escape = false;
		}
		// If no `esc` filter is found, then we'll need to add one.
		elseif (! preg_match('/\s+esc/', $key))
		{
			$escape = 'html';
		}

		return $escape;
	}
public function shouldAddEscaping ( string $ key ) { $ escape = false ; $ key = trim ( str_replace ( [ '{' , '}' ] , '' , $ key ) ) ; // If the key has a context stored (from setData) // we need to respect that. if ( array_key_exists ( $ key , $ this -> dataContexts ) ) { if ( $ this -> dataContexts [ $ key ] !== 'raw' ) { return $ this -> dataContexts [ $ key ] ; } } // No pipes, then we know we need to escape elseif ( strpos ( $ key , '|' ) === false ) { $ escape = 'html' ; } // If there's a `noescape` then we're definitely false. elseif ( strpos ( $ key , 'noescape' ) !== false ) { $ escape = false ; } // If no `esc` filter is found, then we'll need to add one. elseif ( ! preg_match ( '/\s+esc/' , $ key ) ) { $ escape = 'html' ; } return $ escape ; }
Checks the placeholder the view provided to see if we need to provide any autoescaping.

@param string $key

@return false|string
Checks the placeholder the view provided to see if we need to provide any autoescaping .