From ccbe03ed544d63f92a067da1ecdade73a0d46426 Mon Sep 17 00:00:00 2001 From: Przemek Rzad Date: Tue, 20 Aug 2024 12:05:12 +0200 Subject: [PATCH] Handle filenames with whitespaces in the RFC book (#115) With a recent PR that has spaces in the RFC filename, the RFC book generation script started failing - this fixes it. --- .github/scripts/build-mdbook-summary.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/build-mdbook-summary.js b/.github/scripts/build-mdbook-summary.js index 2a781d8..871793f 100644 --- a/.github/scripts/build-mdbook-summary.js +++ b/.github/scripts/build-mdbook-summary.js @@ -26,7 +26,9 @@ module.exports = async ({github, context}) => { } // Relative path, without the src prefix (format required by mdbook) const relativePath = filePath.replace("mdbook/src/", "") - fs.appendFileSync(summaryPath, `- [${title}](${relativePath})\n`) + // Wrapping the path allows for whitespaces in the filename. + const target = `<${relativePath}>` + fs.appendFileSync(summaryPath, `- [${title}](${target})\n`) } }