Skip to content

Commit d88b75e

Browse files
committed
linkcheck fixes:
- don't try to index that old shell script under product_docs - avoid exponential reprocessing when faced with lots of embedded html
1 parent 1394c16 commit d88b75e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tools/automation/actions/link-check/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ if (!process.env.GITHUB_REF) {
108108

109109
ghCore.context = (filePath, line, column) => {
110110
console.log(
111-
`in https://github.com/EnterpriseDB/docs/blob/${branch}/${filePath}?plain=1#L${line}`,
111+
`in https://github.com/${process.env.GITHUB_REPOSITORY}/blob/${branch}/${filePath}?plain=1#L${line}`,
112112
);
113113
};
114114
}
@@ -120,7 +120,7 @@ async function main() {
120120
? !!ghCore.getInput("update-links")
121121
: args.fix;
122122
const sourceFiles = await glob([
123-
path.resolve(basePath, "product_docs/**/*.mdx"),
123+
path.resolve(basePath, "product_docs/docs/**/*.mdx"),
124124
path.resolve(basePath, "advocacy_docs/**/*.mdx"),
125125
]);
126126

@@ -190,15 +190,15 @@ async function main() {
190190
//
191191
const resourceFiles = await glob([
192192
...resourceExts.flatMap((ext) => [
193-
path.resolve(basePath, "product_docs/**/*" + ext),
193+
path.resolve(basePath, "product_docs/docs/**/*" + ext),
194194
path.resolve(basePath, "advocacy_docs/**/*" + ext),
195195
]),
196196
...imageExts.flatMap((ext) => [
197-
path.resolve(basePath, "product_docs/**/*" + ext),
197+
path.resolve(basePath, "product_docs/docs/**/*" + ext),
198198
path.resolve(basePath, "advocacy_docs/**/*" + ext),
199199
]),
200200
...rawExts.flatMap((ext) => [
201-
path.resolve(basePath, "product_docs/**/*" + ext),
201+
path.resolve(basePath, "product_docs/docs/**/*" + ext),
202202
path.resolve(basePath, "advocacy_docs/**/*" + ext),
203203
]),
204204
]);

tools/automation/actions/link-check/lib/mdast-embedded-hast.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ export default function remarkMdxEmbeddedHast() {
9090
let endIndex = index + 1;
9191
while (
9292
endIndex < parent.children.length &&
93-
parent.children[endIndex].value !== valueToMatch
93+
!(parent.children[endIndex].type === "jsx" && parent.children[endIndex].value.startsWith(valueToMatch))
9494
) {
95-
if (parent.children[endIndex].type === "jsx")
96-
visitor(parent.children[endIndex], endIndex, parent);
9795
++endIndex;
9896
}
9997

@@ -112,6 +110,8 @@ export default function remarkMdxEmbeddedHast() {
112110
endIndex - index - 1,
113111
);
114112

113+
visit(replacement.children[0], "jsx", visitor);
114+
115115
return replacement;
116116
}
117117
}

0 commit comments

Comments
 (0)