diff options
author | Sam Ruby <rubys@intertwingly.net> | 2018-08-05 15:09:15 -0400 |
---|---|---|
committer | Refael Ackermann <refack@gmail.com> | 2019-03-10 10:26:29 -0400 |
commit | cba2c7a87463b16b1b2bec2785b31f09390f135c (patch) | |
tree | e6800aec25d6befd89df8d002c74def66bfaf50e /tools/doc/html.js | |
parent | 8d665c0a8a2542f4d757eb4f0b57e4aa7694dbef (diff) | |
download | node-new-cba2c7a87463b16b1b2bec2785b31f09390f135c.tar.gz |
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 <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'tools/doc/html.js')
-rw-r--r-- | tools/doc/html.js | 22 |
1 files changed, 1 insertions, 21 deletions
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); |