From 48f9c1800aab02f7d3dc402ffe17284b15d3be84 Mon Sep 17 00:00:00 2001 From: silverpill Date: Mon, 19 Sep 2022 00:04:06 +0000 Subject: [PATCH] Add object link handlers to all matching elements --- src/components/Post.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Post.vue b/src/components/Post.vue index e3ce0f5..8bb65f9 100644 --- a/src/components/Post.vue +++ b/src/components/Post.vue @@ -301,10 +301,10 @@ onMounted(() => { } const quote = props.post.quote if (quote) { - const quotes = postContentRef.querySelectorAll(".quote-inline a") - for (const quoteElement of Array.from(quotes)) { - if (quote.uri === quoteElement.getAttribute("href")) { - quoteElement.addEventListener("click", (event: Event) => { + const links = postContentRef.querySelectorAll("a") + for (const linkElement of Array.from(links)) { + if (quote.uri === linkElement.getAttribute("href")) { + linkElement.addEventListener("click", (event: Event) => { event.preventDefault() router.push({ name: "post", params: { postId: quote.id } }) })