mirror of
https://github.com/alrayyes/wiki.git
synced 2025-06-07 14:16:40 +00:00
scss support
This commit is contained in:
parent
c1c46ad67e
commit
42d3a7de17
15 changed files with 574 additions and 99 deletions
quartz/plugins/transformers
|
@ -38,17 +38,21 @@ export class ObsidianFlavoredMarkdown extends QuartzTransformerPlugin {
|
|||
const backlinkRegex = new RegExp(/!?\[\[([^\[\]\|\#]+)(#[^\[\]\|\#]+)?(\|[^\[\]\|\#]+)?\]\]/, "g")
|
||||
return (tree: Root, _file) => {
|
||||
findAndReplace(tree, backlinkRegex, (value: string, ...capture: string[]) => {
|
||||
const [path, rawHeader, rawAlias] = capture
|
||||
const header = rawHeader?.slice(1).trim() ?? ""
|
||||
const alias = rawAlias?.slice(1).trim() ?? value
|
||||
const url = slugify(path.trim() + header)
|
||||
return {
|
||||
type: 'link',
|
||||
url,
|
||||
children: [{
|
||||
type: 'text',
|
||||
value: alias
|
||||
}]
|
||||
if (value.startsWith("!")) {
|
||||
|
||||
} else {
|
||||
const [path, rawHeader, rawAlias] = capture
|
||||
const header = rawHeader?.slice(1).trim() ?? ""
|
||||
const alias = rawAlias?.slice(1).trim() ?? path
|
||||
const url = slugify(path.trim() + header)
|
||||
return {
|
||||
type: 'link',
|
||||
url,
|
||||
children: [{
|
||||
type: 'text',
|
||||
value: alias
|
||||
}]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue