Improve titles

This commit is contained in:
Andras Schmelczer 2022-09-28 14:29:26 +02:00
parent 2bb2117a59
commit 22f636466e
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E

View file

@ -1,2 +1,5 @@
export const titleToFragment = (title: string): string =>
'#' + encodeURIComponent(title.toLocaleLowerCase().replace(/\W+/g, '-'));
'#' +
encodeURIComponent(
title.toLocaleLowerCase().replace(/&.*?;/g, '').replace(/\W+/g, '-')
);