@param $content

@return mixed|string
344618
function modifyContent(&$content) {
    	//Remove comments
		$content = preg_replace('#\/\*(?!\*\/)(.*?)\*\/#si', '', $content);
		$content = str_replace('<!--', '', $content);
		$content = str_replace('-->', '', $content);
		$content = trim($content);

		if (!isset($this->url)) return $content;
		$this->regex = array();
		$this->replace = array();

		$pathinfo = parse_url($this->url);

		$sorceurl = $pathinfo['scheme'] . '://' . $pathinfo['host'] . '/';

		$sorcepath = explode('/', $pathinfo['path']);
		array_shift($sorcepath);
		array_pop($sorcepath);

		$sorcepathoriginal = $sorcepath;

		while(count($sorcepath)) {
			$temp = $sorcepathoriginal;
			$path = '';
			foreach($sorcepath as $values) {
				$path .= '\.\.\/';
				array_pop($temp);
			}

			$turl = $sorceurl;
			if (count($temp)) {
				$turl .= implode('/', $temp) . '/';
			}
			$this->regex[] = '#' . $path . '#iSs';
			$this->replace[] = $turl;
			array_pop($sorcepath);
		}

		$this->thisUrl = $sorceurl . implode('/', $sorcepathoriginal) . '/';

		$this->regex[] = '#\.\/#is';
		$this->replace[] = $sorceurl . implode('/', $sorcepathoriginal) . '/';

		$this->regex[] = '#url\(([^"\'\)]*)\)#is';
		$this->replace[] = 'url("$1")';

		$this->regex[] = '#url\(["\']/([^"\']*)["\']\)#Sis';
		$this->replace[] = 'url("' . $sorceurl . '$1")';

		$this->regex[] = '#url\(["\'](?!\w{0,10}://)([^"\']*)["\']\)#Sis';
		$this->replace[] = 'url("' . $sorceurl . implode('/', $sorcepathoriginal) . '/$1")';

		$regexall = $this->regex;
		$replaceall = $this->replace;

		$content = preg_replace($regexall, $replaceall, $content);

		if (preg_match_all('#@import.*?[\'"]([^\'"]*)[\'"].*?;#Sis', $content, $imports)) {
			foreach ($imports[1] as $key => $import) {
				$cssparser = new Css($this->prefix);
				$cssparser->ParseUrl($import);
				$temp = $cssparser->GetCSS();

				$content = str_replace($imports[0][$key], '', $content );

				$content = $temp . $content;
			}
		}
		return $content;
	}
806412
private function detectFormatByContent($content)
    {
        if (preg_match('/^\\{.*\\}$/is', $content)) {
            return self::FORMAT_JSON;
        }
        if (preg_match('/^([^=&])+=[^=&]+(&[^=&]+=[^=&]+)*$/', $content)) {
            return self::FORMAT_URLENCODED;
        }
        if (preg_match('/^<.*>$/s', $content)) {
            return self::FORMAT_XML;
        }
    }
501253
protected function _get_domain( $content ) {
		$permalink = $this->get_permalink();
		if ( ! $permalink ) {
			$permalink = $this->_get_permalink( $content );
		}

		preg_match( '/https?:\/\/([^\/]+)/', $permalink, $reg );
		if ( ! empty( $reg[1] ) ) {
			return $reg[1];
		}
	}
986131
public function strip($content)
    {
        if (empty($this->shortcodes)) {
            return $content;
        }

        $pattern = $this->getRegex();

        return preg_replace_callback("/{$pattern}/s", function ($m) {
            if ($m[1] == '[' && $m[6] == ']') {
                return substr($m[0], 1, -1);
            }

            return $m[1].$m[6];
        }, $content);
    }
1034487
protected function padContent($content)
    {
        if (strlen($this->char) > 0) {
            $length = $this->getLength();
            $padding_length = ceil($length / mb_strlen($this->char));

            $padding = str_repeat($this->char, $padding_length);
            $content .= mb_substr($padding, 0, $length - mb_strlen($content));
        }

        return $content;
    }
873580
public function prepareContent($content)
    {
        if (is_array($content)) {
            $ctt = '';
            foreach ($content as $key=>$ctt_entry) {
                $ctt .= $ctt_entry;
            }
            $content = $ctt;
        }
        return (string) $content;
    }
832439
protected function getResponseJson($content)
    {
        $this->response = new Response\Json\Api();
        $this->response->setHttpCode(200);
        $this->response->setContent($content);

        return $this->response;
    }
1143094
public static function markdown(&$content)
    {
        if (self::$MarkdownParser === null) {
            if (class_exists('dflydev\markdown\MarkdownParser')) {
                self::$MarkdownParser = new \dflydev\markdown\MarkdownParser;
            } else {
                self::$MarkdownParser = false;
            }
        }

        if (self::$MarkdownParser !== false) {
            $content = trim(self::$MarkdownParser->transformMarkdown($content));
        }

        return $content;
    }
1357879
protected function includeExpr($content)
    {
        try {
            $pattern = '/<!--#if([\s\t]?)expr="([^"]*)"([\s\t]?)-->([^"]*)<!--#endif-->/sU';
            $content = preg_replace($pattern, '', $content);
            return $content;
        } catch (\Exception $e) {
            $this->error(500);
        }
    }
367077
public function decode_content($content) {
        if (!$content = $this->precheck_content($content)) { // Perform some prechecks
            return false;
        }
        // Iterate over all rules, chaining results
        foreach ($this->rules as $rule) {
            $content = $rule->decode($content);
        }
        return $content;
    }
387517
public function parse($content)
    {
        $processor = new Processor(new RegexParser(), $this->handlers);

        return $processor->process($content);
    }
371636
public static function parseLines($content)
    {
        // Split by line
        $lines = explode("\n", $content);

        // Trim and convert to lowercase
        $lines = array_map('trim', $lines);
        $lines = array_map('strtolower', $lines);

        // Remove empty lines and comments
        $lines = array_filter($lines, function ($line) {
            return (0 === strlen($line) || '#' === $line[0]) ? false : $line;
        });

        return $lines;
    }
1205005
protected function _replaceCdata($content) {
		foreach ($this->_cdata as $n => $data) {
			$data = '<![CDATA[' . $data . ']]>';
			$content = str_replace('###CDATA-' . $n . '###', $data, $content);
		}
		return $content;
	}
1349698
public static function bb(&$content)
    {
        $content = preg_replace(array_flip(self::$_bbs), self::$_bbs, $content);

        return $content;
    }
903744
public function findPagesByContent($content)
    {
        $contentUids = array_merge($this->getContentsParentUids($content->getUid()), [$content->getUid()]);
        $contentUids = implode(', ', array_unique(array_map(function ($uid) {
            return '"'.$uid.'"';
        }, $contentUids)));

        $pageUids = $this->_em->getConnection()->executeQuery(
            sprintf('SELECT uid FROM page WHERE contentset IN (%s)', $contentUids)
        )->fetchAll(\PDO::FETCH_COLUMN);

        return $this->_em->createQueryBuilder('p')
            ->select('p')
            ->from('BackBee\NestedNode\Page', 'p')
            ->where('p._uid IN (:uids)')
            ->setParameter('uids', $pageUids)
            ->getQuery()
            ->getResult()
        ;
    }
105368
public function generateSearchText($content)
    {
        $content = $this->_defaultData($content);
        $searchText = $this->_generateSearchText($content->text, $content->colour);
        return parent::generateSearchText($searchText);
    }
1156807
public function parseLang($content) {
        $this->_content = $content;
        $this->_parseDebugStart();
        $this->_parsePath();
        $this->_parseGravatar();
        $this->_parseUrl();
        $this->_parsePhp();
        $this->_parseLang();
        $this->_parseForeach();
        $this->_parseFor();
        $this->_parseVar();
        $this->_parseVarFunc();
        $this->_parseCondition();
        $this->_parseFunction();
        $this->_parseException();
        $this->_parseDebugEnd();

        return $this->_content;
    }