Skip to content
Prev Previous commit
Next Next commit
support non-english chars
  • Loading branch information
mishig25 committed Oct 4, 2023
commit 893a34d8a64f73120d4c848b3ec5eab0c442c3bd
4 changes: 2 additions & 2 deletions kit/preprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ function escapeSvelteSpecialChars() {
local = title
.trim()
.toLowerCase()
.replace(/[^\w\s-]/g, "")
.replace(/[\s_-]+/g, "-");
.replace(/\s+/g, '-') // Replace spaces with hyphens
.replace(/[^\p{L}\p{N}-]+/gu, ''); // Keep letters, numbers, and hyphens only
}
headings = addToTree(headings, { title, local, sections: [], depth });

Expand Down