Skip to content

Commit f97c1b0

Browse files
Scroogey-SNhuumn
andauthored
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 <k00b@stacker.news>
1 parent 43edef5 commit f97c1b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rehype-sn.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ export default function rehypeSN (options = {}) {
5959
if (node.properties.href.includes('#itemfn-')) {
6060
node.tagName = 'footnote'
6161
} else {
62-
const { itemId, linkText } = parseInternalLinks(node.properties.href)
63-
if (itemId) {
62+
const { itemId, commentId, linkText } = parseInternalLinks(node.properties.href)
63+
if (itemId || commentId) {
6464
node.tagName = 'item'
65-
node.properties.id = itemId
65+
node.properties.id = commentId || itemId
6666
if (node.properties.href === toString(node)) {
6767
node.children[0].value = linkText
6868
}

0 commit comments

Comments
 (0)