markdown/directives/yaml

(require("markdown/directives/yaml"))(text, looseDirectivesopt) → {Object|false}

Parse text as YAML by using js-yaml's FAILSAFE_SCHEMA.

Source:
Parameters:
Name Type Attributes Default Description
text String

Target text.

looseDirectives boolean | Array.<string> <optional>
false

By setting true, it try to parse as loose YAML only in defined Marpit built-in directives. You may also extend target keys for loose parsing by passing an array of strings.

Returns:
Type:
Object | false

Return parse result, or false when failed to parse.