Skip to content

Commit f1b593c

Browse files
authored
build: escape handlebars in step source README.md copies (#287)
The previous fix wrapped {{ ... }} / {% ... %} placeholders in fenced code blocks and inline code spans only when generating the HTML pages under dist/<tutorial>/build/<step>/README.md. The downloadable step sources copied to dist/<tutorial>/steps/<step>/README.md were left untouched and went through Jekyll/Liquid as-is, so placeholders such as {{appTitle}} and {{appDescription}} were stripped on the published site. Run the README files copied alongside the step sources through escapeCodeBlocks() as well so both rendering paths preserve the handlebars placeholders verbatim.
1 parent e09b3fc commit f1b593c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tools/builder/prepare-gh-pages.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ function removeTSfromUI5YAML(ui5yaml) {
209209
} else if(file.endsWith(".yaml")) {
210210
const ui5yaml = removeTSfromUI5YAML(yaml.load(readFileSync(source, { encoding: "utf8" })));
211211
writeFileSync(target, yaml.dump(ui5yaml));
212+
} else if (file.endsWith("README.md")) {
213+
let content = escapeCodeBlocks(readFileSync(source, { encoding: "utf8"}));
214+
mkdirSync(dirname(target), { recursive: true });
215+
writeFileSync(target, content, { encoding: "utf8" });
212216
} else if (file !== "tsconfig.json") {
213217
mkdirSync(dirname(target), { recursive: true });
214218
copyFileSync(source, target);

0 commit comments

Comments
 (0)