|
|
|
|
@ -27,7 +27,7 @@ import mditCjkFriendly from 'markdown-it-cjk-friendly'
|
|
|
|
|
import { full as emojiPlugin } from 'markdown-it-emoji'
|
|
|
|
|
import type { BuiltinLanguage, BuiltinTheme, Highlighter } from 'shiki'
|
|
|
|
|
import type { Logger } from 'vite'
|
|
|
|
|
import type { Awaitable } from '../shared'
|
|
|
|
|
import type { Awaitable, ExternalLinkAttrValue } from '../shared'
|
|
|
|
|
import { containerPlugin, type ContainerOptions } from './plugins/containers'
|
|
|
|
|
import { gitHubAlertsPlugin } from './plugins/githubAlerts'
|
|
|
|
|
import { highlight as createHighlighter } from './plugins/highlight'
|
|
|
|
|
@ -63,7 +63,7 @@ export interface MarkdownOptions extends MarkdownItAsyncOptions {
|
|
|
|
|
* Disable cache (experimental)
|
|
|
|
|
*/
|
|
|
|
|
cache?: boolean
|
|
|
|
|
externalLinks?: Record<string, string>
|
|
|
|
|
externalLinks?: Record<string, string | ExternalLinkAttrValue>
|
|
|
|
|
|
|
|
|
|
/* ==================== Syntax Highlighting ==================== */
|
|
|
|
|
|
|
|
|
|
@ -286,7 +286,11 @@ export async function createMarkdownRenderer(
|
|
|
|
|
imagePlugin(md, options.image)
|
|
|
|
|
linkPlugin(
|
|
|
|
|
md,
|
|
|
|
|
{ target: '_blank', rel: 'noreferrer', ...options.externalLinks },
|
|
|
|
|
{
|
|
|
|
|
target: '_blank',
|
|
|
|
|
rel: { value: 'noreferrer', join: true },
|
|
|
|
|
...options.externalLinks
|
|
|
|
|
},
|
|
|
|
|
base,
|
|
|
|
|
slugify
|
|
|
|
|
)
|
|
|
|
|
|