Skip to content

Commit c6ec99b

Browse files
nodejs-github-bottargos
authored andcommitted
tools: update lint-md-dependencies to [email protected]
PR-URL: #43871 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 5c8aebb commit c6ec99b

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed

tools/lint-md/lint-md.mjs

+6-6
Original file line numberDiff line numberDiff line change
@@ -10748,6 +10748,7 @@ const findAndReplace =
1074810748
const replace = pairs[pairIndex][1];
1074910749
let start = 0;
1075010750
const index = parent.children.indexOf(node);
10751+
let change = false;
1075110752
let nodes = [];
1075210753
let position;
1075310754
find.lastIndex = 0;
@@ -10763,9 +10764,7 @@ const findAndReplace =
1076310764
if (typeof value === 'string') {
1076410765
value = value.length > 0 ? {type: 'text', value} : undefined;
1076510766
}
10766-
if (value === false) {
10767-
position = undefined;
10768-
} else {
10767+
if (value !== false) {
1076910768
if (start !== position) {
1077010769
nodes.push({
1077110770
type: 'text',
@@ -10778,19 +10777,20 @@ const findAndReplace =
1077810777
nodes.push(value);
1077910778
}
1078010779
start = position + match[0].length;
10780+
change = true;
1078110781
}
1078210782
if (!find.global) {
1078310783
break
1078410784
}
1078510785
match = find.exec(node.value);
1078610786
}
10787-
if (position === undefined) {
10788-
nodes = [node];
10789-
} else {
10787+
if (change) {
1079010788
if (start < node.value.length) {
1079110789
nodes.push({type: 'text', value: node.value.slice(start)});
1079210790
}
1079310791
parent.children.splice(index, 1, ...nodes);
10792+
} else {
10793+
nodes = [node];
1079410794
}
1079510795
return index + nodes.length
1079610796
}

tools/lint-md/package-lock.json

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

tools/lint-md/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"devDependencies": {
1717
"@rollup/plugin-commonjs": "^22.0.1",
1818
"@rollup/plugin-node-resolve": "^13.3.0",
19-
"rollup": "^2.76.0",
19+
"rollup": "^2.77.0",
2020
"rollup-plugin-cleanup": "^3.2.1"
2121
}
2222
}

0 commit comments

Comments
 (0)