lib/Pico.php
public function prepareFileContent($rawContent, array $meta = array())
    {
        // remove meta header
        $metaHeaderPattern = "/^(\/(\*)|---)[[:blank:]]*(?:\r)?\n"
            . "(?:(.*?)(?:\r)?\n)?(?(2)\*\/|---)[[:blank:]]*(?:(?:\r)?\n|$)/s";
        $markdown = preg_replace($metaHeaderPattern, '', $rawContent, 1);

        // replace placeholders
        $markdown = $this->substituteFileContent($markdown, $meta);

        return $markdown;
    }
public function prepareFileContent($rawContent, array $meta = array())
    {
        // remove meta header
        $metaHeaderPattern = "/^(\/(\*)|---)[[:blank:]]*(?:\r)?\n"
            . "(?:(.*?)(?:\r)?\n)?(?(2)\*\/|---)[[:blank:]]*(?:(?:\r)?\n|$)/s";
        $markdown = preg_replace($metaHeaderPattern, '', $rawContent, 1);

        // replace placeholders
        $markdown = $this->substituteFileContent($markdown, $meta);

        return $markdown;
    }
public function prepareFileContent ( $ rawContent , array $ meta = array ( ) ) { // remove meta header $ metaHeaderPattern = "/^(\/(\*)|---)[[:blank:]]*(?:\r)?\n" . "(?:(.*?)(?:\r)?\n)?(?(2)\*\/|---)[[:blank:]]*(?:(?:\r)?\n|$)/s" ; $ markdown = preg_replace ( $ metaHeaderPattern , '' , $ rawContent , 1 ) ; // replace placeholders $ markdown = $ this -> substituteFileContent ( $ markdown , $ meta ) ; return $ markdown ; }
Applies some static preparations to the raw contents of a page

This method removes the meta header and replaces `%...%` placeholders
by calling the {@see Pico::substituteFileContent()} method.

@see Pico::substituteFileContent()
@see Pico::parseFileContent()
@see Pico::getFileContent()

@param string $rawContent raw contents of a page
@param array  $meta       meta data to use for %meta.*% replacement

@return string prepared Markdown contents
Applies some static preparations to the raw contents of a page