From 5e2a1b51c8d74ebb7577270c02bc3ee74b038506 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Tue, 20 Apr 2021 12:49:57 -0400 Subject: [PATCH] update scripts to fix a few bugs --- script/content-migrations/remove-map-topics.js | 5 +++++ script/content-migrations/update-tocs.js | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/script/content-migrations/remove-map-topics.js b/script/content-migrations/remove-map-topics.js index b19b694703..ec24064da7 100755 --- a/script/content-migrations/remove-map-topics.js +++ b/script/content-migrations/remove-map-topics.js @@ -3,6 +3,7 @@ const fs = require('fs') const path = require('path') const walk = require('walk-sync') +const stripHtmlComments = require('strip-html-comments') const languages = require('../../lib/languages') const frontmatter = require('../../lib/read-frontmatter') const addRedirectToFrontmatter = require('../../lib/redirects/add-redirect-to-frontmatter') @@ -26,6 +27,10 @@ const categoryIndexFiles = fullDirectoryPaths.map(fullDirectoryPath => walk(full categoryIndexFiles.forEach(categoryIndexFile => { let categoryIndexContent = fs.readFileSync(categoryIndexFile, 'utf8') + if (categoryIndexFile.endsWith('github/getting-started-with-github/index.md')) { + categoryIndexContent = stripHtmlComments(categoryIndexContent.replace(/\n