inline scripts

This commit is contained in:
Jacky Zhao 2023-06-03 15:07:19 -04:00
parent fcd81353f8
commit 4bdc17d4a1
19 changed files with 187 additions and 69 deletions
quartz/plugins/transformers

View file

@ -12,7 +12,7 @@ export interface Options {
const defaultOptions: Options = {
highlight: true,
wikilinks: true
wikilinks: true,
}
export class ObsidianFlavoredMarkdown extends QuartzTransformerPlugin {
@ -39,10 +39,10 @@ export class ObsidianFlavoredMarkdown extends QuartzTransformerPlugin {
return (tree: Root, _file) => {
findAndReplace(tree, backlinkRegex, (value: string, ...capture: string[]) => {
if (value.startsWith("!")) {
// TODO: handle embeds
} else {
const [path, rawHeader, rawAlias] = capture
const anchor = rawHeader?.slice(1).trim() ?? ""
const anchor = rawHeader?.trim() ?? ""
const alias = rawAlias?.slice(1).trim() ?? path
const url = slugify(path.trim() + anchor)
return {