Website: Update generated subtopics in Markdown content (#10724)

https://fleetdm.slack.com/archives/C01EZVBHFHU/p1679598174642469

Changes:
- Updated the handbook and documentation pages page script to strip `'`
characters from subtopic IDs before they're converted to kebab case.
This commit is contained in:
Eric 2023-03-23 15:13:51 -05:00 committed by GitHub
parent ee116d14ca
commit b6fa586904
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -120,7 +120,7 @@ parasails.registerPage('basic-documentation', {
let subtopics = $('#body-content').find('h2.markdown-heading').map((_, el) => el.innerText);
subtopics = $.makeArray(subtopics).map((title) => {
// Removing all apostrophes from the title to keep _.kebabCase() from turning words like 'users' into 'user-s'
let kebabCaseFriendlyTitle = title.replace(/[\]/g, '');
let kebabCaseFriendlyTitle = title.replace(/[\\']/g, '');
return {
title,
url: '#' + _.kebabCase(kebabCaseFriendlyTitle.toLowerCase()),

View file

@ -83,7 +83,7 @@ parasails.registerPage('basic-handbook', {
}
subtopics = $.makeArray(subtopics).map((title) => {
// Removing all apostrophes from the title to keep _.kebabCase() from turning words like 'users' into 'user-s'
let kebabCaseFriendlyTitle = title.replace(/[\]/g, '');
let kebabCaseFriendlyTitle = title.replace(/[\\']/g, '');
return {
title: title.replace(/([\uE000-\uF8FF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF])/g, ''), // take out any emojis (they look weird in the menu)
url: '#' + _.kebabCase(kebabCaseFriendlyTitle.toLowerCase()),