fix: improve regex for weight formatting in formatMeta function (#11640)

This commit is contained in:
Arjun Porwal 2025-06-19 22:08:24 +05:30 committed by GitHub
parent e0bb094e01
commit d5da43bbf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,7 +52,7 @@ function formatMeta (meta?: Meta): [React.ReactNode, React.ReactNode] | null {
firstEmpty === -1
? strings
: strings.slice(0, firstEmpty)
).join(' ').replace(/#(<weight>| <weight>).*<\/weight>/, '');
).join(' ').replace(/# ?<weight>[^<]*<\/weight>/, '');
const parts = splitParts(combined.replace(/\\/g, '').replace(/`/g, ''));
return [