★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/700df16a04Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
tools: update to mdast-util-to-hast v3.0.2
See syntax-tree/mdast-util-to-hast#21

Note: I updated all of the tools/doc dependencies, not just this one,
and removed the previous workaround that was in place until this change
landed.

PR-URL: #22140
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
rubys authored and BethGriggs committed Apr 16, 2019
1 parent f0acdfd commit 700df16a04e32dff30566ce322bce3f3dbafbf1c
Showing with 72 additions and 58 deletions.
  1. +1 −21 tools/doc/html.js
  2. +68 −34 tools/doc/package-lock.json
  3. +3 −3 tools/doc/package.json
@@ -161,7 +161,7 @@ function linkJsTypeDocs(text) {

// Preprocess headers, stability blockquotes, and YAML blocks.
function preprocessElements({ filename }) {
return (tree, file) => {
return (tree) => {
const STABILITY_RE = /(.*:)\s*(\d)([\s\S]*)/;
let headingIndex = -1;
let heading = null;
@@ -170,26 +170,6 @@ function preprocessElements({ filename }) {
if (node.type === 'heading') {
headingIndex = index;
heading = node;

// Ensure optional API parameters are not treated as links by
// collapsing all of heading into a single text node.
if (heading.children.length > 1) {
const position = {
start: heading.children[0].position.start,
end: heading.position.end
};

heading.children = [{
type: 'text',
value: file.contents.slice(
position.start.offset, position.end.offset)
.replace('&lt;', '<')
.replace('&gt;', '>')
.replace(/\\(.{1})/g, '$1'),
position
}];
}

} else if (node.type === 'html' && common.isYAMLBlock(node.value)) {
node.value = parseYAML(node.value);

Some generated files are not rendered by default. Learn more.

@@ -12,14 +12,14 @@
"remark-html": "^7.0.0",
"remark-parse": "^5.0.0",
"remark-rehype": "^3.0.0",
"to-vfile": "^5.0.0",
"to-vfile": "^5.0.1",
"unified": "^7.0.0",
"unist-util-find": "^1.0.1",
"unist-util-select": "^1.5.0",
"unist-util-visit": "^1.3.1"
"unist-util-visit": "^1.4.0"
},
"devDependencies": {
"js-yaml": "^3.5.2"
"js-yaml": "^3.12.2"
},
"optionalDependencies": {},
"bin": "./generate.js"

0 comments on commit 700df16

Please sign in to comment.