Skip to content

Commit 6637bcf

Browse files
authored
fix: strip apostrophes and backticks in slug generation (#1478)
- If a section contains an apostroph or backtick, jumping to it will not work - Example: ```Creating SPM's `Package.swift` File``` must be made to `creating-spms-packageswift-file`
1 parent ca46e70 commit 6637bcf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

www/static/js/docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $(document).ready(function () {
5757
// a better regex would have been /[^\d\s\w-_]/ug, but the 'u' flag
5858
// (Unicode) is not supported in some browsers, and we support
5959
// many languages that use Unicode characters
60-
text = text.replace(/[\[\]\(\)\;\:\=\+\?\!\.\,\{\}\\\/\>\<]/g, '');
60+
text = text.replace(/[\[\]\(\)\;\:\=\+\?\!\.\,\{\}\\\/\>\<'`]/g, '');
6161

6262
// trim remaining whitespace
6363
text = text.trim();

0 commit comments

Comments
 (0)