mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-03 15:28:14 +00:00
inline scripts
This commit is contained in:
parent
fcd81353f8
commit
4bdc17d4a1
19 changed files with 187 additions and 69 deletions
quartz/plugins/transformers
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue