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>
This commit is contained in:
Scroogey-SN 2025-02-27 19:10:42 +00:00 committed by GitHub
parent 43edef55eb
commit f97c1b04e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}