[PR] Merge pull request #173 from LS-KR/fix-html-comment

[F] Fix html comment could not be used in markdown
pull/183/head
Azalea 2024-01-14 13:51:06 -05:00 committed by GitHub
commit 77579a1762
Signed by: github
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ function buildPeopleInfoAndList() {
const info: any = YAML.load(infoFile);
// Read the page.md of that language
const markdown = fs.readFileSync(path.join(srcPath, `page${lang}.md`), "utf-8");
const markdown = fs.readFileSync(path.join(srcPath, `page${lang}.md`), "utf-8").replaceAll("<!--", "{/* ").replaceAll("-->", " */}");
// Get the markdown header
const mdMeta = metadataParser(markdown).metadata
@ -118,7 +118,7 @@ function buildPeoplePages() {
for (const lang of ['', '.zh_hant', '.en'])
{
// Read markdown page and remove markdown meta
let markdown = metadataParser(fs.readFileSync(path.join(srcPath, `page${lang}.md`), "utf-8")).content;
let markdown = metadataParser(fs.readFileSync(path.join(srcPath, `page${lang}.md`), "utf-8")).content.replaceAll("<!--", "{/* ").replaceAll("-->", " */}");
// Autocorrect markdown
markdown = autocorrect.formatFor(markdown, 'markdown')