Fix isSafeTagId regex to allow hyphens, matching PerformancePage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 21:45:53 +08:00
parent bbcbdf542a
commit 2b5938738e

View File

@@ -421,7 +421,7 @@ function handleClick(tagId) {
* @returns {boolean} True if the tag ID is safe. * @returns {boolean} True if the tag ID is safe.
*/ */
function isSafeTagId(tagId) { function isSafeTagId(tagId) {
const pattern = /^#?[a-zA-Z0-9]*$/; const pattern = /^#?[a-zA-Z0-9-]*$/;
return pattern.test(tagId); return pattern.test(tagId);
} }