Z plaintextu udělá HTML kód tím, že zaktivní odkazy
@param type $input
@param type $stripTags
@param type $blankTarget
@return type
515403
static function processLinksInText($input, $stripTags=false, $blankTarget=true) {

		if ($stripTags) $input=strip_tags($input);

		//Add protocol to www links without one. We use ahttp to strip it later
		$input = preg_replace("~([^\w\/:-_]|^)(www\.[^<>,\s\)]+\.\w+)~i","\\1ahttp://\\2", $input);

		//Make classical links
		$input = preg_replace("~([a-zA-Z]{2,10}):\/\/([^<>,\s\)]+)~i","<a href=\"\\0\"".($blankTarget?" target=\"_blank\"":"").">\\0</a>", $input);

		//Strip ahttp back
		$input = str_replace("href=\"ahttp://","href=\"http://", $input);
		$input = str_replace("ahttp://","", $input);

		//E-mailové odkazy
		$input = preg_replace('~[\w\.\-]+@[^<>\s]+[\w]~',"<a href=\"mailto:\\0\">\\0</a>", $input);
		$input=trim($input);

		return $input;
	}
158503
function FrontMatter($input)
    {
        if (!$this->startsWith($input, $this->yaml_separator)) {
            # No front matter
            # Store Content in Final array
            $final['content'] = $input;
            # Return Final array
            return $final;
        }

        # Explode Seperators. At most, make three pieces out of the input file
        $document = explode($this->yaml_separator,$input, 3);
        
        switch( sizeof($document) ) {
            case 0:
            case 1:
                // Empty document
                $front_matter = "";
                $content = "";
                break;
            case 2:
                # Only front matter given
                $front_matter = $document[1];
                $content = "";
                break;
            default:
                # Normal document
                $front_matter = $document[1];
                $content = $document[2];
        }
        
        # Parse YAML
		try {
			$final = Yaml::parse($front_matter);
		} catch (ParseException $e) {
			printf("Unable to parse the YAML string: %s", $e->getMessage());
		}
        
        # Store Content in Final array
        $final['content'] = $content;
        
        # Return Final array
        return $final;
    }
1097202
public function dump($input, $inline = 5, $indent = 4, $flags = 0)
    {
        return SymfonyYaml::dump($input, $inline, $indent, $flags);
    }
668519
public function getStrippedText($_stripBasic = false, $_replacements = array())
    {
        $text = $this->text;

        if ($_stripBasic) {
            $text = strip_tags($text);
        }

        $patterns = "/{[^}]+}/";
        $repl = "";
        $text = preg_replace($patterns, $repl, $text);

        if (count($_replacements) > 0) {
            $text = str_replace(array_keys($_replacements), array_values($_replacements), $text);
            $text = iconv('UTF-8', 'UTF-8//IGNORE', $text);
        }

        return $text;
    }
812399
public function parse($trigger, $input)
    {
        $trigger = $this->parseTags($trigger, $input);

        if ($trigger === $input->source()) {
            return $this->triggerFound();
        }

        return $this->triggerNotFound();
    }
1334323
public function createInstruction(InputDescriptor $input, TemplateInterface $template, array $flags = [])
    {
        if (!$template->getManaged()) {
            return null;
        }

        $cacheItem = $this->cacheManager->findByTemplateAndFile($template->getKey(), $input->getFileId(), $input->getFileVersion());

        if (in_array(Batch::FILTER_ERROR, $flags) && $cacheItem && !$this->isError($cacheItem)) {
            $this->logger->info('Skipping non-error item');

            return null;
        }

        if (in_array(Batch::FILTER_MISSING, $flags) && $cacheItem && !$this->isMissing($cacheItem)) {
            $this->logger->info('Skipping non-missing item');

            return null;
        }

        if (in_array(Batch::FILTER_UNCACHED, $flags) && $cacheItem && $this->isCached($cacheItem)) {
            $this->logger->info('Skipping cached item');

            return null;
        }

        if (!$cacheItem) {
            $cacheItem = new CacheItem();
            $cacheItem
                ->setId($this->cacheIdStrategy->createCacheId($template, $input))
                ->setVolumeId($input->getVolumeId())
                ->setFileId($input->getFileId())
                ->setFileVersion($input->getFileVersion())
                ->setTemplateKey($template->getKey())
                ->setTemplateRevision($template->getRevision())
                ->setCacheStatus(CacheItem::STATUS_WAITING)
                ->setQueueStatus(CacheItem::QUEUE_WAITING)
                ->setCreatedAt(new \DateTime());
        }

        $cacheItem
            ->setQueuedAt(new \DateTime());

        return new Instruction($input, $template, $cacheItem);
    }
1075649
public static function textFormGroup( $label = null, $labelAttributes = array(), $inputAttributes = array(), $wrapper = null )
    {
        $_label = static::label( array_merge( $labelAttributes, array('class' => 'form-label') ), $label );
        $_input = static::text( array_merge( $inputAttributes, array('class' => 'form-control') ), null, $wrapper );

        return static::div( array('class' => 'form-group'), $_label . $_input );
    }
805690
public static function stripTagsDeep($arr, $allowTags = '') {
		if (is_array($arr)) {
			foreach ($arr as $key => $val) {
				$arr[$key] = stripTagsDeep($val, $allowTags);
			}
		} else {
			$arr = static::stripTags($arr, $allowTags);
		}

		return $arr;
	}
193474
public function edit( $id, $data, $stripTags = TRUE ){
		$this->table->focusPrimary( $id );
		$result	= 0;
		if( count( $this->table->get( FALSE ) ) )
			$result	= $this->table->update( $data, $stripTags );
		$this->table->defocus();
		$this->cache->remove( $this->cacheKey.$id );
		return $result;
	}
919291
protected function diffElements($oldText, $newText, $stripWrappingTags = true)
    {
        $wrapStart = '';
        $wrapEnd = '';

        if ($stripWrappingTags) {
            $pattern = '/(^<[^>]+>)|(<\/[^>]+>$)/iu';
            $matches = array();

            if (preg_match_all($pattern, $newText, $matches)) {
                $wrapStart = isset($matches[0][0]) ? $matches[0][0] : '';
                $wrapEnd = isset($matches[0][1]) ? $matches[0][1] : '';
            }
            $oldText = preg_replace($pattern, '', $oldText);
            $newText = preg_replace($pattern, '', $newText);
        }

        $diff = self::create($oldText, $newText, $this->config);

        return $wrapStart.$diff->build().$wrapEnd;
    }
654680
public static function input(Input $input, $filter = self::FILTER_NONE): string
    {
        return self::tag($input->tag(), $input->attributes(), $input->value(), $filter, $input);
    }
120698
protected function tempInlineElements($input)
    {
        // Remove inline elements and replace them with text entities.
        if (preg_match_all('/<(' . implode('|', $this->inlineElements) . ')[^>]*>(?:[^<]*)<\/\1>/', $input, $matches)) {
            $this->temporaryReplacementsInline = $matches[0];

            foreach ($matches[0] as $i => $match) {
                $input = str_replace($match, 'ᐃ' . ($i + 1) . 'ᐃ', $input);
            }
        }

        return $input;
    }
1193082
public function makenice($input)
    {
        $output = strip_tags($input);
        $output = $this->autolink($output);
        $output = nl2br($output);

        return $output;
    }
759616
public function plain($value, $minLength = 0, $maxLength = false, $default = false)
	{
		$value = strip_tags($value);

		return $this->str($value, $minLength, $maxLength, $default);
	}
408703
public static function strip($text = '', array $allowedTags = []): string
    {
        $text = \htmlspecialchars_decode((string)$text, ENT_COMPAT | ENT_HTML5);
        foreach ($allowedTags as $tag) {
            $text = \preg_replace('|<(/?'.$tag.'\ ?/?)>|i', '{{{{\\1}}}}', $text);
            $text = \preg_replace('|<('.$tag.' [^>]+)>|i', '{{{{\\1}}}}', $text);
        }
        $text = \preg_replace('/<[^>]+>/', ' ', $text);
        foreach ($allowedTags as $tag) {
            $text = \preg_replace('|{{{{(/?'.$tag.'\ ?/?)}}}}|i', '<\\1>', $text);
            $text = \preg_replace('|{{{{('.$tag.' [^}]+)}}}}|i', '<\\1>', $text);
        }
        $text = \preg_replace('/\s+/', ' ', $text);

        return \trim($text);
    }
1026374
public function parse($trigger, $input)
    {
        $trigger = $this->parseTags($trigger, $input);

        $wildcards = [
            '/\*$/'             => '.*?',
            '/\*/'              => '\\w+?',
            '/#/'               => '\\d+?',
            '/_/'               => '[a-z]?',
            '/<zerowidthstar>/' => '^\*$',
        ];

        foreach ($wildcards as $pattern => $replacement) {
            $parsedTrigger = preg_replace($pattern, '('.$replacement.')', $trigger);

            if (@preg_match_all('/'.$parsedTrigger.'$/u', $input->source(), $stars)) {
                array_shift($stars);

                $stars = Collection::make($stars)->flatten()->all();

                synapse()->memory->shortTerm()->put('stars', $stars);

                return $this->triggerFound();
            }
        }

        return $this->triggerNotFound();
    }
902408
public function html($input = null) {
        if (is_null($input)) {
            return $this->getHtml();
        } else {
            return $this->setHtml($input);
        }
    }