From 700df16a04e32dff30566ce322bce3f3dbafbf1c Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Sun, 5 Aug 2018 15:09:15 -0400 Subject: [PATCH] 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 +------- tools/doc/package-lock.json | 102 ++++++++++++++++++++++++------------ tools/doc/package.json | 6 +-- 3 files changed, 72 insertions(+), 58 deletions(-) diff --git a/tools/doc/html.js b/tools/doc/html.js index ce53bceaa24a15..e8c5f465d98cdc 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); diff --git a/tools/doc/package-lock.json b/tools/doc/package-lock.json index 5b8b52ac041187..7a2bd4991a8690 100644 --- a/tools/doc/package-lock.json +++ b/tools/doc/package-lock.json @@ -5,9 +5,33 @@ "requires": true, "dependencies": { "@types/node": { - "version": "10.3.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.5.tgz", - "integrity": "sha512-6lRwZN0Y3TuglwaaZN2XPocobmzLlhxcqDjKFjNYSsXG/TFAGYkCqkzZh4+ms8iTHHQE6gJXLHPV7TziVGeWhg==" + "version": "10.5.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.6.tgz", + "integrity": "sha512-c5Z1j1ysgo4878ptz6gxLcgMfJ6Wf908R3l5KAGabr0XJ72ZFmOCgsaodPpNYTfp4iOrSwgTDvR/BxbFfB4zPQ==" + }, + "@types/unist": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", + "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==" + }, + "@types/vfile": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/vfile/-/vfile-3.0.2.tgz", + "integrity": "sha512-b3nLFGaGkJ9rzOcuXRfHkZMdjsawuDD0ENL9fzTophtBg8FJHSGbH7daXkEpcwy3v7Xol3pAvsmlYyFhR4pqJw==", + "requires": { + "@types/node": "*", + "@types/unist": "*", + "@types/vfile-message": "*" + } + }, + "@types/vfile-message": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/vfile-message/-/vfile-message-1.0.1.tgz", + "integrity": "sha512-mlGER3Aqmq7bqR1tTTIVHq8KSAFFRyGbrxuM8C/H82g6k7r2fS+IMEkIu3D7JHzG10NvPdR8DNx0jr0pwpp4dA==", + "requires": { + "@types/node": "*", + "@types/unist": "*" + } }, "argparse": { "version": "1.0.10", @@ -102,9 +126,9 @@ } }, "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "extend": { @@ -161,9 +185,9 @@ "integrity": "sha512-s/ggaNehYVqmLgTXEv12Lbb72bsOD2r5DhAqPgtDdaI/YFNXVzz0zHFVJnhjIjn7Nak8GbL4nzT2q0RA5div+A==" }, "hast-util-parse-selector": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.1.1.tgz", - "integrity": "sha512-FlrdvixBzVHYSqtvGAl0wjH1hiCY5NEfs+zfFNAZNWKMVj4pH6x+uPPyrhvzU3NrwOqYVX6Essv4d5n+0b6faA==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.0.tgz", + "integrity": "sha512-trw0pqZN7+sH9k7hPWCJNZUbWW2KroSIM/XpIy3G5ZMtx9LSabCyoSp4skJZ4q/eZ5UOBPtvWh4W9c+RE3HRoQ==" }, "hast-util-raw": { "version": "2.0.2", @@ -297,9 +321,9 @@ "integrity": "sha512-T3FlsX8rCHAH8e7RE7PfOPZVFQlcV3XRF9eOOBQ1uf70OxO7CjjSOjeImMPCADBdYWcStAbVbYvJ1m2D3tb+EA==" }, "js-yaml": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "version": "3.12.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz", + "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -348,9 +372,9 @@ } }, "mdast-util-to-hast": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-3.0.1.tgz", - "integrity": "sha512-+eimV/12kdg0/T0EEfcK7IsDbSu2auVm92z5jdSEQ3DHF2HiU4OHmX9ir5wpQajr73nwabdxrUoxREvW2zVFFw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-3.0.2.tgz", + "integrity": "sha512-YI8Ea3TFWEZrS31+6Q/d8ZYTOSDKM06IPc3l2+OMFX1o3JTG2mrztlmzDsUMwIXLWofEdTVl/WXBgRG6ddlU/A==", "requires": { "collapse-white-space": "^1.0.0", "detab": "^2.0.0", @@ -524,9 +548,9 @@ } }, "remark-rehype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-3.0.0.tgz", - "integrity": "sha512-WUinfb6vi34f4VYs2XS4HvuYNd0tCu68HOlG4aMp1dfFyVuVfL3aiL9WPw+Q6W99xTTHyxwr7BGO94jF0psoEA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-3.0.2.tgz", + "integrity": "sha512-KDRCnMzRyyCDr0I14Kfk5094W7jjhQwAIJ1C6NniGNjp2OIhcrtqRaiTZCoyEtoYILXTmZKmuOnL5yYGaEFFJA==", "requires": { "mdast-util-to-hast": "^3.0.0" } @@ -587,9 +611,9 @@ } }, "to-vfile": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-5.0.0.tgz", - "integrity": "sha512-sUeBtb4i09pNIzPtl/PMW20Xfe/NK82oV0IehtmoX/+PhIdvc6JHMRnmC4fjCIcy0LOwcNqB8iRMtTBzXHVbng==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-5.0.2.tgz", + "integrity": "sha512-Gp2q0HCUR+4At6c6mvFKug75NP/8Cu5r7ONvEcJJPBGiDT4HeLBrRnPKJbOe84nHJqYhIah2y367Tr2+IUkwMA==", "requires": { "is-buffer": "^2.0.0", "vfile": "^3.0.0" @@ -625,10 +649,12 @@ } }, "unified": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/unified/-/unified-7.0.0.tgz", - "integrity": "sha512-j+Sm7upmmt3RXPBeA+KFGYBlHBxClnby2DtxezFKwMfhWTAklY4WbEdhwRo6c6GpuHdi04YDsyPKY/kh5a/xnQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-7.1.0.tgz", + "integrity": "sha512-lbk82UOIGuCEsZhPj8rNAkXSDXd6p0QLzIuSsCdxrqnqU56St4eyOB+AlXsVgVeRmetPTYydIuvFfpDIed8mqw==", "requires": { + "@types/unist": "^2.0.0", + "@types/vfile": "^3.0.0", "bail": "^1.0.0", "extend": "^3.0.0", "is-plain-obj": "^1.1.0", @@ -694,17 +720,25 @@ "integrity": "sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ==" }, "unist-util-visit": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.3.1.tgz", - "integrity": "sha512-0fdB9EQJU0tho5tK0VzOJzAQpPv2LyLZ030b10GxuzAWEfvd54mpY7BMjQ1L69k2YNvL+SvxRzH0yUIehOO8aA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.0.tgz", + "integrity": "sha512-FiGu34ziNsZA3ZUteZxSFaczIjGmksfSgdKqBfOejrrfzyUy5b7YrlzT1Bcvi+djkYDituJDy2XB7tGTeBieKw==", "requires": { - "unist-util-is": "^2.1.1" + "unist-util-visit-parents": "^2.0.0" + } + }, + "unist-util-visit-parents": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.0.1.tgz", + "integrity": "sha512-6B0UTiMfdWql4cQ03gDTCSns+64Zkfo2OCbK31Ov0uMizEz+CJeAp0cgZVb5Fhmcd7Bct2iRNywejT0orpbqUA==", + "requires": { + "unist-util-is": "^2.1.2" } }, "vfile": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-3.0.0.tgz", - "integrity": "sha512-X2DiPHL9Nxgfyu5DNVgtTkZtD4d4Zzf7rVBVI+uXP2pWWIQG8Ri+xAP9KdH/sB6SS0a1niWp5bRF88n4ciwhoA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-3.0.1.tgz", + "integrity": "sha512-y7Y3gH9BsUSdD4KzHsuMaCzRjglXN0W2EcMf0gpvu6+SbsGhMje7xDc8AEoeXy6mIwCKMI6BkjMsRjzQbhMEjQ==", "requires": { "is-buffer": "^2.0.0", "replace-ext": "1.0.0", @@ -718,9 +752,9 @@ "integrity": "sha512-zM5/l4lfw1CBoPx3Jimxoc5RNDAHHpk6AM6LM0pTIkm5SUSsx8ZekZ0PVdf0WEZ7kjlhSt7ZlqbRL6Cd6dBs6A==" }, "vfile-message": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-1.0.1.tgz", - "integrity": "sha512-vSGCkhNvJzO6VcWC6AlJW4NtYOVtS+RgCaqFIYUjoGIlHnFL+i0LbtYvonDWOMcB97uTPT4PRsyYY7REWC9vug==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-1.1.1.tgz", + "integrity": "sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA==", "requires": { "unist-util-stringify-position": "^1.1.1" } diff --git a/tools/doc/package.json b/tools/doc/package.json index 41ae87889d36e4..89648a84903e5f 100644 --- a/tools/doc/package.json +++ b/tools/doc/package.json @@ -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"