mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-19 10:54:06 -06:00
fix(ofm): support Obsidian block ID wikilinks (#^block-id) navigation
This commit is contained in:
parent
c99c8070f2
commit
7462f249e7
@ -27,6 +27,7 @@ import { toHast } from "mdast-util-to-hast"
|
|||||||
import { toHtml } from "hast-util-to-html"
|
import { toHtml } from "hast-util-to-html"
|
||||||
import { capitalize } from "../../util/lang"
|
import { capitalize } from "../../util/lang"
|
||||||
import { PluggableList } from "unified"
|
import { PluggableList } from "unified"
|
||||||
|
import { slug as slugAnchor } from "github-slugger"
|
||||||
|
|
||||||
export interface Options {
|
export interface Options {
|
||||||
comments: boolean
|
comments: boolean
|
||||||
@ -604,7 +605,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
|||||||
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: slugAnchor(block),
|
||||||
}
|
}
|
||||||
file.data.blocks![block] = node
|
file.data.blocks![block] = node
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user