frontMatterParser = $frontMatterParser; } /** * @throws InvalidFrontMatterException if the front matter cannot be parsed */ public function parse(string $markdownContent): MarkdownInputWithFrontMatter { $cursor = new Cursor($markdownContent); // Locate the front matter $frontMatter = $cursor->match(self::REGEX_FRONT_MATTER); if ($frontMatter === null) { return new MarkdownInputWithFrontMatter($markdownContent); } // Trim the last line (ending ---s and newline) $frontMatter = \preg_replace('/---\R$/', '', $frontMatter); if ($frontMatter === null) { return new MarkdownInputWithFrontMatter($markdownContent); } // Parse the resulting YAML data $data = $this->frontMatterParser->parse($frontMatter); // Advance through any remaining newlines which separated the front matter from the Markdown text $trailingNewlines = $cursor->match('/^\R+/'); // Calculate how many lines the Markdown is offset from the front matter by counting the number of newlines // Don't forget to add 1 because we stripped one out when trimming the trailing delims $lineOffset = \preg_match_all('/\R/', $frontMatter . $trailingNewlines) + 1; return new MarkdownInputWithFrontMatter($cursor->getRemainder(), $lineOffset, $data); } } __halt_compiler();----SIGNATURE:----A/1d2V9GrO8XJ0xYVMSK/JOLDNZV9sE6ZHO5QXWlJGVvyW4mtDqOvAJLiE9r/mnOxp0xglk62li+crmzdaF7oX//KL9WI4I8f/b0RDzzw8/JptzgGg+p26MQd0LCI44StGo4hNys5ekdeTTwNBtNLYQcNBVtdOa5mKkJgK6DclF4B72uH/CDnpkeWq08wsuvD8NaO9ZnnFotwZ1onM4+ZsgE+Gp9i5FifXVy54iVXnfwlIOHEtbJiLo/Tcg7jfVjj+hDosvYmgMAkpu7eRdLL0rWr2RAwNx5EKNQxgeadWbGcrqhJGiNyiJxtSmCYWrgVTjHP+rW/2KuvQl9WMCEdsaz324L9KnroSnP4hvxIjGzfPtd3I2WGCKoub9SqsyGmlh7NH1hiiFVjc2i+n/6QyHq3V+Z12woyMTjtsg/aBH37pkKfS0WAVvEsguW4b0jlP5di5mxV9FfpxSlPx4Hxp/eU5C/PcUxtWPSnzVIyN+Wl5n6uPdEBttvaYH5d0F8V7IpklKPWJpg6IdIIEVKDvR2NwPOGEB6GO04c6nIWdnRoLTUGldGZ6JNx+GizCOVYNBL2qbKmkvReTsH6mXxWVKtKHNt4JsENZQqdR1s5i3RHNroP86yc/WwyRmjvFfQtuvKllJ5FKsIQOBRtGEDdR7fCSJ548iHM3vudh02sdI=----ATTACHMENT:----MTcxMzQxNjM5OTA5Mzg5OCAyMDc4NDY3Mzg0MDU4Njk1IDQ5NDkwODI1Mjc3NDE=