Merge pull request #1823 from PR0M3TH3AN/fix-tag-pill-list-hash-prefix-10215423449371014011

Fix missing hash prefix in video tag pills causing test failures
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-27 12:25:55 -05:00
commit d46fd2abd5
1 file changed
+3 -3
+3 -3
View File
@@ -62,8 +62,8 @@ function createTagButton({ doc, tag, onTagActivate, getTagState }) {
const button = doc.createElement("button");
button.type = "button";
button.classList.add("pill", "video-tag-pill", "focus-ring");
button.dataset.tag = tag;
const displayTag = tag.startsWith("#") ? tag : `#${tag}`;
button.dataset.tag = displayTag;
button.title = displayTag;
const label = doc.createElement("span");
@@ -95,7 +95,7 @@ function createTagButton({ doc, tag, onTagActivate, getTagState }) {
if (getTagState) {
try {
const state = getTagState(tag);
const state = getTagState(displayTag);
applyPreferenceState(button, state);
} catch (error) {
// Ignore state resolution errors; leave button in neutral state.
@@ -106,7 +106,7 @@ function createTagButton({ doc, tag, onTagActivate, getTagState }) {
if (onTagActivate) {
const handler = (event) => {
onTagActivate(tag, { event, button });
onTagActivate(displayTag, { event, button });
};
button.addEventListener("click", handler);
// Store the handler for cleanup when the strip is updated.