Redundant

This commit is contained in:
Emile Bangma 2025-04-04 22:07:33 +00:00 committed by GitHub
parent 6b67446ce5
commit 74d908261f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 12 deletions

View File

@ -88,9 +88,7 @@ async function mouseEnterHandler(
el.id = targetID
})
console.log(hash)
const targetLink = hash.startsWith("#popover")
? hash
: `#popover-${hash.slice(1)}`
const targetLink = hash.startsWith("#popover") ? hash : `#popover-${hash.slice(1)}`
hash = targetLink
const elts = [...html.getElementsByClassName("popover-hint")]
if (elts.length === 0) return

View File

@ -545,15 +545,11 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
if (matches && matches.length >= 1) {
parent!.children.splice(index! + 2, 1)
const block = matches[0].slice(1)
const anchor = block.startsWith("/")
? `#block-${block.slice(1)}`
: `#block-${block}`
if (!Object.keys(file.data.blocks!).includes(block)) {
node.properties = {
...node.properties,
id: block,
href: anchor,
}
file.data.blocks![block] = node
}
@ -567,9 +563,6 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
if (matches && matches.length >= 1) {
last.value = last.value.slice(0, -matches[0].length)
const block = matches[0].slice(1)
const anchor = block.startsWith("/")
? `#block-${block.slice(1)}`
: `#block-${block}`
if (last.value === "") {
// this is an inline block ref but the actual block
@ -585,7 +578,6 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
element.properties = {
...element.properties,
id: block,
href: anchor,
}
file.data.blocks![block] = element
}
@ -598,7 +590,6 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
node.properties = {
...node.properties,
id: block,
href: anchor,
}
file.data.blocks![block] = node
}