Handbook: strip emojis when displaying subsection titles in nav (#4381)

This commit is contained in:
Mike McNeil 2022-02-27 21:25:46 -06:00 committed by GitHub
parent c50bfee5d1
commit 43871ff387
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,7 @@ parasails.registerPage('basic-handbook', {
debug: false,
clickAnalytics: true,
algoliaOptions: {
'facetFilters': ['section:handbook']
facetFilters: ['section:handbook']
},
});
@ -47,7 +47,7 @@ parasails.registerPage('basic-handbook', {
// Removing all apostrophes from the title to keep _.kebabCase() from turning words like 'users' into 'user-s'
let kebabCaseFriendlyTitle = title.replace(/[\]/g, '');
return {
title,
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),
};
});