Skip to content

Commit 9d92887

Browse files
rubysBridgeAR
authored andcommitted
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>
1 parent bf78365 commit 9d92887

File tree

3 files changed

+72
-58
lines changed

3 files changed

+72
-58
lines changed

tools/doc/html.js

+1-21
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function linkJsTypeDocs(text) {
161161

162162
// Preprocess headers, stability blockquotes, and YAML blocks.
163163
function preprocessElements({ filename }) {
164-
return (tree, file) => {
164+
return (tree) => {
165165
const STABILITY_RE = /(.*:)\s*(\d)([\s\S]*)/;
166166
let headingIndex = -1;
167167
let heading = null;
@@ -170,26 +170,6 @@ function preprocessElements({ filename }) {
170170
if (node.type === 'heading') {
171171
headingIndex = index;
172172
heading = node;
173-
174-
// Ensure optional API parameters are not treated as links by
175-
// collapsing all of heading into a single text node.
176-
if (heading.children.length > 1) {
177-
const position = {
178-
start: heading.children[0].position.start,
179-
end: heading.position.end
180-
};
181-
182-
heading.children = [{
183-
type: 'text',
184-
value: file.contents.slice(
185-
position.start.offset, position.end.offset)
186-
.replace('&lt;', '<')
187-
.replace('&gt;', '>')
188-
.replace(/\\(.{1})/g, '$1'),
189-
position
190-
}];
191-
}
192-
193173
} else if (node.type === 'html' && common.isYAMLBlock(node.value)) {
194174
node.value = parseYAML(node.value);
195175

tools/doc/package-lock.json

+68-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/doc/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"remark-html": "^7.0.0",
1313
"remark-parse": "^5.0.0",
1414
"remark-rehype": "^3.0.0",
15-
"to-vfile": "^5.0.0",
15+
"to-vfile": "^5.0.1",
1616
"unified": "^7.0.0",
1717
"unist-util-find": "^1.0.1",
1818
"unist-util-select": "^1.5.0",
19-
"unist-util-visit": "^1.3.1"
19+
"unist-util-visit": "^1.4.0"
2020
},
2121
"devDependencies": {
22-
"js-yaml": "^3.5.2"
22+
"js-yaml": "^3.12.2"
2323
},
2424
"optionalDependencies": {},
2525
"bin": "./generate.js"

0 commit comments

Comments
 (0)