feat: process tags in content

This commit is contained in:
Jacky Zhao 2023-07-23 14:02:57 -07:00
parent ae2e3b463a
commit 5599eb590e
4 changed files with 41 additions and 20 deletions
quartz/plugins/transformers

View file

@ -72,7 +72,8 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options> | undefined> =
typeof node.properties.href === "string"
) {
let dest = node.properties.href as RelativeURL
node.properties.className = isAbsoluteUrl(dest) ? "external" : "internal"
node.properties.className ??= []
node.properties.className.push(isAbsoluteUrl(dest) ? "external" : "internal")
// don't process external links or intra-document anchors
if (!(isAbsoluteUrl(dest) || dest.startsWith("#"))) {