| | |
| | | enableYouTubeEmbed: boolean |
| | | enableVideoEmbed: boolean |
| | | enableCheckbox: boolean |
| | | disableBrokenWikilinks: boolean |
| | | } |
| | | |
| | | const defaultOptions: Options = { |
| | |
| | | enableYouTubeEmbed: true, |
| | | enableVideoEmbed: true, |
| | | enableCheckbox: false, |
| | | disableBrokenWikilinks: false, |
| | | } |
| | | |
| | | const calloutMapping = { |
| | |
| | | |
| | | return src |
| | | }, |
| | | markdownPlugins(_ctx) { |
| | | markdownPlugins(ctx) { |
| | | const plugins: PluggableList = [] |
| | | |
| | | // regex replacements |
| | |
| | | // otherwise, fall through to regular link |
| | | } |
| | | |
| | | // treat as broken link if slug not in ctx.allSlugs |
| | | if (opts.disableBrokenWikilinks) { |
| | | const slug = slugifyFilePath(fp as FilePath) |
| | | const exists = ctx.allSlugs && ctx.allSlugs.includes(slug) |
| | | if (!exists) { |
| | | return { |
| | | type: "html", |
| | | value: `<a class=\"internal broken\">${alias ?? fp}</a>`, |
| | | } |
| | | } |
| | | } |
| | | |
| | | // internal link |
| | | const url = fp + anchor |
| | | |