Remove all shortcode tags from the given content.
@uses $shortcode_tags
@param string $content Content to remove shortcode tags.
@return string Content without shortcode tags.
496566
public function stripAllShortcodes($content)
    {
        if (empty($this->_shortcodes)) {
            return $content;
        }
        return preg_replace_callback($this->shortcodeRegex(), [$this, 'stripShortcodeTag'], $content);
    }
107929
public function strip(array $tag, $content) {
        $email = isset($tag['attributes']['default']) ? $tag['attributes']['default'] : $content;

        return parent::strip($tag, $email);
    }
1127259
public static function stripUnicodeRanges($content)
    {
        foreach (self::$stripUnicodeRanges as $range) {
            $content = self::stripUnicodeRange($content, $range[0], $range[1]);
        }

        return $content;
    }
652081
public function stripSpecialCharacter($content)
    {
        if (is_string($content))
        {
            $content = str_replace(chr(194) . chr(160), ' ', $content);
        }

        return $content;
    }
709961
public function deleteRegions($content, $regions)
    {
        foreach ($regions as $region) {
            $region->detach();
            $this->manager->remove($region);
            $this->manager->flush();
        }
    }
1186340
private static function isValid(string $content): bool
    {
        if ('' === $content) {
            return false;
        }

        return (bool)preg_match_all(static::getPlaceholderPattern(), $content);
    }
669724
public static function getHtmlTags($content, $closeTags = true)
    {
        if ($closeTags == true) {
            $re = '@<[^>]*>@';
        } else {
            $re = '@<[^>/]*>@';
        }

        preg_match_all($re, $content, $matches, PREG_SET_ORDER, 0);

        if (isset($matches) && !empty($matches)) {
            $tags = array();
            foreach ($matches as $match) {
                $tags[] = $match[0];
            }

            $tags = array_unique($tags);

            return $tags;
        }

        return;
    }
159538
private function stripComments(string $content): string
    {
        $tokens = token_get_all($content);

        $content_sans_comments = array_reduce(
            $tokens,
            function ($carry, $token) {
                if (is_string($token)) {
                    // simple 1-character token
                    return $carry . $token;
                } else {
                    // token array
                    list($id, $text) = $token;
                    switch ($id) {
                        case T_COMMENT:
                        case T_DOC_COMMENT:
                            // no action on comments
                            break;
                        default:
                            // anything else -> output "as is"
                            return $carry . $text;
                            break;
                    }
                }

                return $carry;
            },
            ""
        );
        return $content_sans_comments;
    }
1070066
private function parseCodeForMethods( $content )
	{
		$this->methods	= array();																	//  reset list of found methods
		$open		= FALSE;																		//  initial: no method found, yet
		$content	= preg_replace( "@/\*.*\*/@Us", "", $content );									//  remove all slash-star-comments
//		$content	= preg_replace( '@".*"@Us', "", $content );										//  remove all strings
		$content	= preg_replace( "@'.*'@Us", "", $content );										//  remove all strings
		$content	= preg_replace( "@#.+\n@U", "", $content );										//  remove all hash-comments
		$content	= preg_replace( "@\s+\n@U", "\n", $content );									//  trailing white space
		$content	= preg_replace( "@\n\n@U", "\n", $content );									//  remove double line breaks
		$content	= preg_replace( "@//\s*[\w|\s]*\n@U", "\n", $content );							//  remove comment lines
		$matches	= array();																		//  prepare empty matches array
		$count		= 0;																			//  initial: open bracket counter
		foreach( explode( "\n", $content ) as $nr => $line )										//  iterate code lines
		{
			$line	= trim( $line );																//  remove leading and trailing white space
			if( !$open )																			//  if no method found, yet
			{
				$regExp	= '@^(abstract )?(final )?(static )?(protected |private |public )?(static )?function ([\w]+)\((.*)\)(\s*{\s*)?;?\s*$@s';	//  prepare regular expression for method/function signature
				if( preg_match( $regExp, $line ) )													//  line is method/function signature
				{
					$regExp	= "@^.*function ([^(]+) ?\((.*)\).*$@i";								//  prepare regular expression for method/function name and parameters
					$name	= preg_replace( $regExp, "\\1@@\\2", $line );							//  find method/function name and parameters
					$parts	= explode( "@@", $name );												//  split name and parameters
					$open	= trim( $parts[0] );															//  note found method/function
					$matches[$open]['variables']	= array();										//  prepare empty method/function parameter list
					$matches[$open]['lines']		= array();										//  prepare empty method/function line list
					$parts[1]	= preg_replace( '@\(.*\)@U', "", $parts[1] );										//  remove all strings
					if( isset( $parts[1] ) && trim( $parts[1] ) )									//  parameters are defined
					{
						$params	= explode( ",", $parts[1] );										//  split parameters
						foreach( $params as $param )												//  iterate parameters
						{
							$regExp		= '@^([a-z0-9_]+ )?&?\$(.+)(\s?=\s?.*)?$@Ui';				//  prepare regular expression for parameter name
							$param		= preg_replace( $regExp, "\\2", trim( $param ) );			//  get clean parameter name
							$matches[$open]['variables'][$param]	= 0;							//  note parameter in method variable list
						}
					}
					if( preg_match( "/\{$/", $line ) )												//  signature line ends with opening bracket
						$count++;																	//  increase open bracket counter
				}
			}
			else																					//  inside method code lines
			{
				$matches[$open]['lines'][$nr]	= $line;											//  note method code line for inspection
				if( preg_match( "/^\{$/", $line ) || preg_match( "/\{$/", $line ) )					//  line contains opening bracket
					$count++;																		//  increase open bracket counter
				else if( preg_match( "/^\}/", $line ) || preg_match( "/\}$/", $line ) )				//  line contains closing bracket
					if( !( --$count ) )																//  decrease open bracket counter and if all open brackets are closed
						$open	= FALSE;															//  leave method code mode
			}
		}
		$this->methods	= $matches;																	//  note all found methods and their variables
	}
1319025
public function doShortcode(string $content, $tags = [], bool $deep = false): string
    {
        $tags = $this->preProcessTags($tags);
        $handler = function (string $tag, ?string $content = null, array $atts = []) {
            $shortcode = $this[$tag];

            if ($shortcode instanceof AttributeInterface) {
                $atts = array_merge($shortcode->getAttributes(), $atts);

                return $shortcode->handle($content, $atts);
            }

            return $shortcode->handle($content);
        };

        $result = (string) $this->parser->parseShortcode($content, $tags, $handler);

        if ($deep && $this->hasShortcode($result, $tags)) {
            return $this->doShortcode($result, $tags, $deep);
        }

        return $result;
    }
905513
public static function nullMinifier($content)
    {
        if (isset($content[0]) && $content[0] === "\xef") {
            $content = substr($content, 3);
        }
        $content = str_replace("\r\n", "\n", $content);

        return trim($content);
    }
79386
protected function processNoConvert(string &$content): void
    {
        $pattern = '/{!}(' . preg_quote($this->startTag) . '.+?' . preg_quote($this->endTag) . ')/s';
        $content = preg_replace($pattern, '\1', $content);
    }
499455
public function equationShortCodeHandler( $atts, $content, $shortcode ) {
		if ( ! $content ) {
			return '';
		}
		$atts = shortcode_atts(
			[
				'size' => 0,
				'color' => false,
				'background' => false,
			], $atts
		);

		return do_shortcode_by_tags(
			sprintf(
				'<p>[latex%1$s]%2$s[/latex]' . "</p>\n",
				( $atts['size'] !== 0 )
				? sprintf(
					' size="%1$s" color="%2$s" background="%3$s"',
					$atts['size'],
					$atts['color'],
					$atts['background']
				)
				: sprintf(
					' color="%1$s" background="%2$s"',
					$atts['color'],
					$atts['background']
				),
				$content
			),
			[ 'latex' ]
		);
	}
427645
protected function renderTag($content = null)
    {
        $attributes = $this->renderAttributes();

        if ($this->isVoid) {
            return sprintf(
                '<%1$s%2$s%3$s>',
                $this->tag,
                $attributes,
                $this->isXhtml ? ' /' : ''
            );
        }

        return sprintf(
            '<%1$s%2$s>%3$s</%1$s>',
            $this->tag,
            $attributes,
            $content
        );
    }
880882
public static function encodeUnicode($content)
    {
        $content = self::shortcodeToUnicode($content);
        $content = self::entitiesToUnicode($content);

        return $content;
    }
239975
protected function sanitizeContent($content) {
    $regex = '/^\n' . preg_quote($this->blockStart, '/') . ".*?" . preg_quote($this->blockEnd, '/') . '\n/sm';
    return preg_replace($regex, '', $content);
  }
144238
protected function removeAttributionLink( $content ) {
		if ( stripos( $content, '<a' ) === false ) {
			// There are no <a> tags to look at, skip this
			return $content;
		}

		$changed = false;
		$html5 = new HtmlParser();
		$dom = $html5->loadHTML( $content );

		$urls = $dom->getElementsByTagName( 'a' );
		foreach ( $urls as $url ) {
			/** @var \DOMElement $url */
			// Is this the the attributionUrl?
			if ( $url->getAttribute( 'rel' ) === 'cc:attributionURL' ) {
				$url->parentNode->replaceChild(
					$dom->createTextNode( $url->nodeValue ),
					$url
				);
				$changed = true;
			}
		}

		if ( ! $changed ) {
			return $content;
		} else {
			$content = $html5->saveHTML( $dom );
			$content = $this->html5ToXhtml( $content );
			return $content;
		}
	}