diff --git a/examples/sections.js b/examples/sections.js index bc6a6f3..5b621ed 100644 --- a/examples/sections.js +++ b/examples/sections.js @@ -9,7 +9,7 @@ const str = fs.readFileSync(path.join(__dirname, 'fixtures', 'sections.md')); const file = matter(str, { section: function(section, file) { if (typeof section.data === 'string' && section.data.trim() !== '') { - section.data = yaml.safeLoad(section.data); + section.data = yaml.load(section.data); } section.content = section.content.trim() + '\n'; } diff --git a/lib/engines.js b/lib/engines.js index 38f993d..1dfec8d 100644 --- a/lib/engines.js +++ b/lib/engines.js @@ -13,8 +13,8 @@ const engines = exports = module.exports; */ engines.yaml = { - parse: yaml.safeLoad.bind(yaml), - stringify: yaml.safeDump.bind(yaml) + parse: yaml.load.bind(yaml), + stringify: yaml.dump.bind(yaml) }; /** diff --git a/package.json b/package.json index c5a1fff..2e3b6cb 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "test": "mocha" }, "dependencies": { - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "kind-of": "^6.0.2", "section-matter": "^1.0.0", "strip-bom-string": "^1.0.0" diff --git a/test/parse-custom.js b/test/parse-custom.js index 14047eb..89e925a 100644 --- a/test/parse-custom.js +++ b/test/parse-custom.js @@ -16,7 +16,7 @@ describe('custom parser:', function() { var actual = matter.read('./test/fixtures/lang-yaml.md', { parser: function customParser(str, opts) { try { - return YAML.safeLoad(str, opts); + return YAML.load(str, opts); } catch (err) { throw new SyntaxError(err); }