diff --git a/docs/themes.md b/docs/themes.md index 3f485a79e..6eb436bfd 100644 --- a/docs/themes.md +++ b/docs/themes.md @@ -288,7 +288,7 @@ Docsify provides [theme properties](#theme-properties) for simplified customizat } ``` - ?> **Theme authors**: Consider providing instructions for loading your recommended web fonts manually instead of including them in your theme using `@import`. This allows users who prefer a different font to avoid loading your recommended web font(s) unnecessarily. + > [!TIP] **Theme authors**: Consider providing instructions for loading your recommended web fonts manually instead of including them in your theme using `@import`. This allows users who prefer a different font to avoid loading your recommended web font(s) unnecessarily. 4. Advanced styling may require custom CSS declarations. This is expected, however custom CSS declarations may break when new versions of Docsify are released. When possible, leverage [theme properties](#theme-properties) instead of custom declarations or lock your [CDN](cdn) URLs to a [specific version](cdn#specific-version) to avoid potential issues when using custom CSS declarations. diff --git a/src/core/render/slugify.js b/src/core/render/slugify.js index ff910d684..d27250f65 100644 --- a/src/core/render/slugify.js +++ b/src/core/render/slugify.js @@ -12,7 +12,8 @@ export function slugify(str) { let slug = str .trim() - .normalize('NFKD') + .normalize('NFC') + .replace(/\uFE0F/g, '') .replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]/gu, '') .replace(/[A-Z]+/g, lower) .replace(/<[^>]+>/g, '') diff --git a/test/unit/render-util.test.js b/test/unit/render-util.test.js index 3ff0c1a70..094308ea8 100644 --- a/test/unit/render-util.test.js +++ b/test/unit/render-util.test.js @@ -179,7 +179,7 @@ describe('core/render/slugify', () => { expect(nestedHtmlStrippedSlug).toBe('another-broken-example'); const emojiRemovedSlug = slugify('emoji test ⚠️🔥✅'); - expect(emojiRemovedSlug).toBe('emoji-test-️'); + expect(emojiRemovedSlug).toBe('emoji-test-'); const multiSpaceSlug = slugify('Title with multiple spaces'); expect(multiSpaceSlug).toBe('title----with---multiple-spaces');