From 62c93b3733009dc161f22867ef940ce5e79bedf1 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 30 Mar 2020 12:47:46 +0200 Subject: [PATCH] Update docs for `unified@9.0.0` --- package.json | 4 ++-- readme.md | 7 ++++++- test.js | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3ed986e..a5af891 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,8 @@ "browserify": "^16.0.0", "nyc": "^15.0.0", "prettier": "^2.0.0", - "remark": "^11.0.0", - "remark-cli": "^7.0.0", + "remark": "^12.0.0", + "remark-cli": "^8.0.0", "remark-preset-wooorm": "^6.0.0", "tape": "^4.0.0", "tinyify": "^2.0.0", diff --git a/readme.md b/readme.md index 7b44492..7695618 100644 --- a/readme.md +++ b/readme.md @@ -38,7 +38,7 @@ unified() .use(vdom) .process('Some _emphasis_, **importance**, and `code`.', function(err, file) { if (err) throw err - console.dir(file.contents, {depth: null}) + console.dir(file.result, {depth: null}) }) ``` @@ -119,6 +119,9 @@ VirtualNode { Compile Markdown to [Virtual DOM][vdom]. +> ℹ️ In [`unified@9.0.0`][unified-9], the result of `.process` changed from +> ~~`file.contents`~~ to `file.result`. + ##### `options` ###### `options.sanitize` @@ -268,3 +271,5 @@ abide by its terms. [hint]: https://github.com/Matt-Esch/virtual-dom/tree/master/virtual-hyperscript#key [xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[unified-9]: https://github.com/unifiedjs/unified/releases/tag/9.0.0 diff --git a/test.js b/test.js index 0d892b5..1478f16 100644 --- a/test.js +++ b/test.js @@ -8,7 +8,7 @@ var vdom = require('.') test('remark-vdom', function (t) { function check(fixture, options) { - return vdom2html(remark().use(vdom, options).processSync(fixture).contents) + return vdom2html(remark().use(vdom, options).processSync(fixture).result) } t.equal( @@ -62,7 +62,7 @@ test('remark-vdom', function (t) { ) var node = remark().use(vdom, {prefix: 'f-'}).processSync('_Emphasis_!') - .contents + .result t.equal(node.key, 'f-1', '`prefix`')