diff options
author | Michaël Zasso <targos@protonmail.com> | 2021-09-08 22:49:55 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-09-18 17:32:44 +0300 |
commit | 2b080cb23fac2320c84d79c76603a8a7f9b9a7bc (patch) | |
tree | 55b2f1b058c31af3089056c1ba6bc0e94a6706ac /tools/doc/json.mjs | |
parent | 6ef1d7c3471382bf34c86f9751b420a7435fb381 (diff) |
tools: update doc generator dependencies
PR-URL: https://github.com/nodejs/node/pull/40042
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'tools/doc/json.mjs')
-rw-r--r-- | tools/doc/json.mjs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/doc/json.mjs b/tools/doc/json.mjs index 5bcfd988658..ee8480114df 100644 --- a/tools/doc/json.mjs +++ b/tools/doc/json.mjs @@ -20,7 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import html from 'remark-html'; -import unified from 'unified'; +import { unified } from 'unified'; import { selectAll } from 'unist-util-select'; import * as common from './common.mjs'; @@ -376,7 +376,7 @@ function parseListItem(item, file) { current.textRaw = item.children.filter((node) => node.type !== 'list') .map((node) => ( - file.contents.slice(node.position.start.offset, node.position.end.offset)) + file.value.slice(node.position.start.offset, node.position.end.offset)) ) .join('').replace(/\s+/g, ' ').replace(/<!--.*?-->/sg, ''); let text = current.textRaw; @@ -491,8 +491,8 @@ function newSection(header, file) { function textJoin(nodes, file) { return nodes.map((node) => { if (node.type === 'linkReference') { - return file.contents.slice(node.position.start.offset, - node.position.end.offset); + return file.value.slice(node.position.start.offset, + node.position.end.offset); } else if (node.type === 'inlineCode') { return `\`${node.value}\``; } else if (node.type === 'strong') { |