From f97c1b04e6c7a6708396e78d700730f81f286cec Mon Sep 17 00:00:00 2001 From: Scroogey-SN Date: Thu, 27 Feb 2025 19:10:42 +0000 Subject: [PATCH] Fix issue #1905, item popover with commentId (#1911) * Fix issue #1905, item popover with commentId * Fix issue #1924, require nostr prefixes start with slash * revert hacks and unrelated changes, use commentId in rehype --------- Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com> Co-authored-by: k00b --- lib/rehype-sn.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rehype-sn.js b/lib/rehype-sn.js index 99ba6ddd..d65b3f7c 100644 --- a/lib/rehype-sn.js +++ b/lib/rehype-sn.js @@ -59,10 +59,10 @@ export default function rehypeSN (options = {}) { if (node.properties.href.includes('#itemfn-')) { node.tagName = 'footnote' } else { - const { itemId, linkText } = parseInternalLinks(node.properties.href) - if (itemId) { + const { itemId, commentId, linkText } = parseInternalLinks(node.properties.href) + if (itemId || commentId) { node.tagName = 'item' - node.properties.id = itemId + node.properties.id = commentId || itemId if (node.properties.href === toString(node)) { node.children[0].value = linkText }