public function jsonFrontMatter($text)
    {
        list($text, $frontmatter) = $this->extractFrontMatter($text, "{{{\n", "}}}\n");

        if (!empty($frontmatter)) {
            $frontmatter = json_decode($frontmatter, true);

            if (is_null($frontmatter)) {
                throw new Exception("Failed parsing JSON frontmatter.");
            }
        }

        return [
            "text" => $text,
            "frontmatter" => $frontmatter
        ];
    }
public function jsonFrontMatter($text)
    {
        list($text, $frontmatter) = $this->extractFrontMatter($text, "{{{\n", "}}}\n");

        if (!empty($frontmatter)) {
            $frontmatter = json_decode($frontmatter, true);

            if (is_null($frontmatter)) {
                throw new Exception("Failed parsing JSON frontmatter.");
            }
        }

        return [
            "text" => $text,
            "frontmatter" => $frontmatter
        ];
    }
public function jsonFrontMatter ( $ text ) { list ( $ text , $ frontmatter ) = $ this -> extractFrontMatter ( $ text , "{{{\n" , "}}}\n" ) ; if ( ! empty ( $ frontmatter ) ) { $ frontmatter = json_decode ( $ frontmatter , true ) ; if ( is_null ( $ frontmatter ) ) { throw new Exception ( "Failed parsing JSON frontmatter." ) ; } } return [ "text" => $ text , "frontmatter" => $ frontmatter ] ; }
Extract JSON front matter from text.

@deprecated since 1.2, replaced with filter\Frontmatter.

@param string $text the text to be parsed.

@return array with the formatted text and the front matter.
Extract JSON front matter from text .