mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
Fix anchor id to keep uppercase characters
id shouldn’t be converted to lowercase since id attribute is case sensitive
This commit is contained in:
parent
4b419f4877
commit
919b7467d4
1 changed files with 5 additions and 1 deletions
|
@ -156,7 +156,11 @@ export function renderTags (view) {
|
|||
}
|
||||
|
||||
function slugifyWithUTF8 (text) {
|
||||
let newText = S(text.toLowerCase()).trim().stripTags().dasherize().s
|
||||
// remove html tags and trim spaces
|
||||
let newText = S(text).trim().stripTags().s
|
||||
// replace all spaces in between to dashes
|
||||
newText = newText.replace(/\s+/g, '-')
|
||||
// slugify string to make it valid for attribute
|
||||
newText = newText.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, '')
|
||||
return newText
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue