mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-05-18 14:34:23 +02:00
lint(links.ts): fix declarations
This commit is contained in:
parent
663607d296
commit
a010948644
@ -58,12 +58,12 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options>> = (userOpts)
|
|||||||
node.properties &&
|
node.properties &&
|
||||||
typeof node.properties.href === "string"
|
typeof node.properties.href === "string"
|
||||||
) {
|
) {
|
||||||
let href = node.properties.href
|
const href = node.properties.href
|
||||||
var dest = href as RelativeURL
|
let dest = href as RelativeURL
|
||||||
var refIcon: string | ElementContent | null = null
|
let refIcon: string | ElementContent | null = null
|
||||||
var matched = false
|
let matched = false
|
||||||
opts.substitutions?.every(([regex, sub]) => {
|
opts.substitutions?.every(([regex, sub]) => {
|
||||||
let parts = href.match(regex)
|
const parts = href.match(regex)
|
||||||
if (parts != null) {
|
if (parts != null) {
|
||||||
dest = parts.slice(1).join("") as RelativeURL
|
dest = parts.slice(1).join("") as RelativeURL
|
||||||
if (typeof sub == "object") {
|
if (typeof sub == "object") {
|
||||||
@ -86,25 +86,25 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options>> = (userOpts)
|
|||||||
refIcon != null
|
refIcon != null
|
||||||
? refIcon
|
? refIcon
|
||||||
: {
|
: {
|
||||||
type: "element",
|
type: "element",
|
||||||
tagName: "svg",
|
tagName: "svg",
|
||||||
properties: {
|
properties: {
|
||||||
"aria-hidden": "true",
|
"aria-hidden": "true",
|
||||||
class: "external-icon",
|
class: "external-icon",
|
||||||
style: "max-width:0.8em;max-height:0.8em",
|
style: "max-width:0.8em;max-height:0.8em",
|
||||||
viewBox: "0 0 512 512",
|
viewBox: "0 0 512 512",
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
type: "element",
|
|
||||||
tagName: "path",
|
|
||||||
properties: {
|
|
||||||
d: "M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z",
|
|
||||||
},
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
type: "element",
|
||||||
|
tagName: "path",
|
||||||
|
properties: {
|
||||||
|
d: "M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z",
|
||||||
|
},
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user