markdown/directives/yaml

Source: yaml.js:2


Instance Methods

yaml( text: String, looseDirectives?: boolean | Array.<string>, ): Object | false

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

Parameters

  • text (String) — Target text.
  • looseDirectives (boolean | Array.<string>, optional, default: 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

  • Object | false — Return parse result, or false when failed to parse.