mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
Redundant
This commit is contained in:
parent
6b67446ce5
commit
74d908261f
@ -88,9 +88,7 @@ async function mouseEnterHandler(
|
|||||||
el.id = targetID
|
el.id = targetID
|
||||||
})
|
})
|
||||||
console.log(hash)
|
console.log(hash)
|
||||||
const targetLink = hash.startsWith("#popover")
|
const targetLink = hash.startsWith("#popover") ? hash : `#popover-${hash.slice(1)}`
|
||||||
? hash
|
|
||||||
: `#popover-${hash.slice(1)}`
|
|
||||||
hash = targetLink
|
hash = targetLink
|
||||||
const elts = [...html.getElementsByClassName("popover-hint")]
|
const elts = [...html.getElementsByClassName("popover-hint")]
|
||||||
if (elts.length === 0) return
|
if (elts.length === 0) return
|
||||||
|
|||||||
@ -545,15 +545,11 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
|||||||
if (matches && matches.length >= 1) {
|
if (matches && matches.length >= 1) {
|
||||||
parent!.children.splice(index! + 2, 1)
|
parent!.children.splice(index! + 2, 1)
|
||||||
const block = matches[0].slice(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)) {
|
if (!Object.keys(file.data.blocks!).includes(block)) {
|
||||||
node.properties = {
|
node.properties = {
|
||||||
...node.properties,
|
...node.properties,
|
||||||
id: block,
|
id: block,
|
||||||
href: anchor,
|
|
||||||
}
|
}
|
||||||
file.data.blocks![block] = node
|
file.data.blocks![block] = node
|
||||||
}
|
}
|
||||||
@ -567,9 +563,6 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
|||||||
if (matches && matches.length >= 1) {
|
if (matches && matches.length >= 1) {
|
||||||
last.value = last.value.slice(0, -matches[0].length)
|
last.value = last.value.slice(0, -matches[0].length)
|
||||||
const block = matches[0].slice(1)
|
const block = matches[0].slice(1)
|
||||||
const anchor = block.startsWith("/")
|
|
||||||
? `#block-${block.slice(1)}`
|
|
||||||
: `#block-${block}`
|
|
||||||
|
|
||||||
if (last.value === "") {
|
if (last.value === "") {
|
||||||
// this is an inline block ref but the actual block
|
// this is an inline block ref but the actual block
|
||||||
@ -585,7 +578,6 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
|||||||
element.properties = {
|
element.properties = {
|
||||||
...element.properties,
|
...element.properties,
|
||||||
id: block,
|
id: block,
|
||||||
href: anchor,
|
|
||||||
}
|
}
|
||||||
file.data.blocks![block] = element
|
file.data.blocks![block] = element
|
||||||
}
|
}
|
||||||
@ -598,7 +590,6 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
|||||||
node.properties = {
|
node.properties = {
|
||||||
...node.properties,
|
...node.properties,
|
||||||
id: block,
|
id: block,
|
||||||
href: anchor,
|
|
||||||
}
|
}
|
||||||
file.data.blocks![block] = node
|
file.data.blocks![block] = node
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user