protected function parseYaml($text)
    {
        if ($this->config["yaml_parser_pecl"]
            && function_exists("yaml_parse")
        ) {
            // PECL php5-yaml extension
            $parsed = yaml_parse($text);

            if ($parsed === false) {
                throw new Exception("Failed parsing YAML frontmatter using PECL.");
            }
            return $parsed;
        }

        if ($this->config["yaml_parser_symfony"]
            && method_exists("Symfony\Component\Yaml\Yaml", "parse")
        ) {
            // symfony/yaml
            $parsed = Yaml::parse($text);
            return $parsed;
        }

        if ($this->config["yaml_parser_spyc"]
            && function_exists("spyc_load")
        ) {
            // mustangostang/spyc
            $parsed = spyc_load($text);
            return $parsed;
        }

        throw new Exception("Could not find support for YAML.");
    }