Skip to content

Commit 700df16

Browse files
rubysBethGriggs
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 <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent f0acdfd commit 700df16

File tree

3 files changed

+72
-58
lines changed

3 files changed

+72
-58
lines changed

‎tools/doc/html.js‎

Lines changed: 1 addition & 21 deletions
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
functionpreprocessElements({ filename }){
164-
return(tree,file)=>{
164+
return(tree)=>{
165165
constSTABILITY_RE=/(.*:)\s*(\d)([\s\S]*)/;
166166
letheadingIndex=-1;
167167
letheading=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-
constposition={
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
}elseif(node.type==='html'&&common.isYAMLBlock(node.value)){
194174
node.value=parseYAML(node.value);
195175

‎tools/doc/package-lock.json‎

Lines changed: 68 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/doc/package.json‎

Lines changed: 3 additions & 3 deletions
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)