Skip to content

Commit 5999f09

Browse files
authored
fix: normalize slugs to NFC and remove emoji variation selector (#2597)
1 parent 2e59b0f commit 5999f09

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

docs/themes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ Docsify provides [theme properties](#theme-properties) for simplified customizat
288288
}
289289
```
290290

291-
?> **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.
291+
> [!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.
292292
293293
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.
294294

src/core/render/slugify.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export function slugify(str) {
1212

1313
let slug = str
1414
.trim()
15-
.normalize('NFKD')
15+
.normalize('NFC')
16+
.replace(/\uFE0F/g, '')
1617
.replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]/gu, '')
1718
.replace(/[A-Z]+/g, lower)
1819
.replace(/<[^>]+>/g, '')

test/unit/render-util.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ describe('core/render/slugify', () => {
179179
expect(nestedHtmlStrippedSlug).toBe('another-broken-example');
180180

181181
const emojiRemovedSlug = slugify('emoji test ⚠️🔥✅');
182-
expect(emojiRemovedSlug).toBe('emoji-test-');
182+
expect(emojiRemovedSlug).toBe('emoji-test-');
183183

184184
const multiSpaceSlug = slugify('Title with multiple spaces');
185185
expect(multiSpaceSlug).toBe('title----with---multiple-spaces');

0 commit comments

Comments
 (0)