scss support
This commit is contained in:
@ -3,3 +3,5 @@ export { GitHubFlavoredMarkdown } from './gfm'
|
||||
export { CreatedModifiedDate } from './lastmod'
|
||||
export { Katex } from './latex'
|
||||
export { Description } from './description'
|
||||
export { ResolveLinks } from './links'
|
||||
export { ObsidianFlavoredMarkdown } from './ofm'
|
||||
|
@ -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
|
||||
}]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user