From cba2c7a87463b16b1b2bec2785b31f09390f135c Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Sun, 5 Aug 2018 15:09:15 -0400 Subject: tools: update to mdast-util-to-hast v3.0.2 See https://github.com/syntax-tree/mdast-util-to-hast/pull/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: https://github.com/nodejs/node/pull/22140 Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- tools/doc/html.js | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'tools/doc/html.js') diff --git a/tools/doc/html.js b/tools/doc/html.js index 4d5e31fe9c..c7ffb392e0 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -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('<', '<') - .replace('>', '>') - .replace(/\\(.{1})/g, '$1'), - position - }]; - } - } else if (node.type === 'html' && common.isYAMLBlock(node.value)) { node.value = parseYAML(node.value); -- cgit v1.2.1