Repository navigation
Expand file tree
/
Copy pathadvanced-links.html
More file actions
68 lines (64 loc) · 56.2 KB
/
Copy pathadvanced-links.html
File metadata and controls
68 lines (64 loc) · 56.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!doctype html>
<html lang="en-US" data-theme="light">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="generator" content="VuePress 2.0.0-rc.31" />
<meta name="theme" content="VuePress Theme Hope 2.0.0-rc.110" />
<style>
:root {
--vp-c-bg: #fff;
}
[data-theme="dark"] {
--vp-c-bg: #1b1b1f;
}
html,
body {
background: var(--vp-c-bg);
}
</style>
<script>
const userMode = localStorage.getItem("vuepress-theme-hope-scheme");
const systemDarkMode =
window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
if (userMode === "dark" || (userMode !== "light" && systemDarkMode)) {
document.documentElement.setAttribute("data-theme", "dark");
}
</script>
<script type="application/ld+json">{"@context":"https://schema.org","@type":"Article","headline":"@mdit/plugin-advanced-links","image":[""],"dateModified":"2026-10-13T07:38:21.000Z","author":[]}</script><meta property="og:url" content="https://mdit-plugins.github.io/advanced-links.html"><meta property="og:site_name" content="Markdown It Plugins"><meta property="og:title" content="@mdit/plugin-advanced-links"><meta property="og:description" content="Register custom @[name ...props](link) syntax with your own renderer. Usage The plugin can be used as many times as you need, each call registers one name. Syntax name is the re..."><meta property="og:type" content="article"><meta property="og:locale" content="en-US"><meta property="og:locale:alternate" content="zh-CN"><meta property="og:updated_time" content="2026-10-13T07:38:21.000Z"><meta property="article:modified_time" content="2026-10-13T07:38:21.000Z"><link rel="alternate" hreflang="zh-cn" href="https://mdit-plugins.github.io/zh/advanced-links.html"><title>@mdit/plugin-advanced-links | Markdown It Plugins</title><meta name="description" content="Register custom @[name ...props](link) syntax with your own renderer. Usage The plugin can be used as many times as you need, each call registers one name. Syntax name is the re...">
<link rel="preload" href="/assets/style-2Y7QRtOk.css" as="style"><link rel="stylesheet" href="/assets/style-2Y7QRtOk.css">
<link rel="modulepreload" href="/assets/app-Ddwr36KU.js"><link rel="modulepreload" href="/assets/advanced-links-BrNgXtTn.js"><link rel="modulepreload" href="/assets/plugin-vue_export-helper-BDNMzG2s.js">
</head>
<body>
<div id="app"><!--[--><!--[--><!--[--><span tabindex="-1"></span><a href="#main-content" class="vp-skip-link sr-only">Skip to main content</a><!--]--><!--[--><div class="theme-container external-link-icon has-toc" vp-container><!--[--><header id="navbar" class="vp-navbar" vp-navbar><div class="vp-navbar-start"><button type="button" class="vp-toggle-sidebar-button" title="Toggle Sidebar"><span class="icon"></span></button><!--[--><a class="route-link vp-brand" href="/" aria-label="Take me home"><img class="vp-nav-logo" src="/logo.svg" alt><!----><span class="vp-site-name hide-in-pad">Markdown It Plugins</span></a><!--]--></div><div class="vp-navbar-center"><!--[--><!----><!--]--></div><div class="vp-navbar-end"><!--[--><div class="vp-nav-item"><div class="vp-dropdown-wrapper"><button type="button" class="vp-dropdown-title" aria-label="Select language"><!--[--><svg xmlns="http://www.w3.org/2000/svg" class="icon i18n-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="i18n icon" name="i18n" style="width:1rem;height:1rem;vertical-align:middle;"><path d="M379.392 460.8 494.08 575.488l-42.496 102.4L307.2 532.48 138.24 701.44l-71.68-72.704L234.496 460.8l-45.056-45.056c-27.136-27.136-51.2-66.56-66.56-108.544h112.64c7.68 14.336 16.896 27.136 26.112 35.84l45.568 46.08 45.056-45.056C382.976 312.32 409.6 247.808 409.6 204.8H0V102.4h256V0h102.4v102.4h256v102.4H512c0 70.144-37.888 161.28-87.04 210.944L378.88 460.8zM576 870.4 512 1024H409.6l256-614.4H768l256 614.4H921.6l-64-153.6H576zM618.496 768h196.608L716.8 532.48 618.496 768z"></path></svg><!--]--><span class="arrow"></span><ul class="vp-dropdown"><li class="vp-dropdown-item"><a class="route-link route-link-active auto-link" href="/advanced-links.html" aria-label="English"><!---->English<!----></a></li><li class="vp-dropdown-item"><a class="route-link auto-link" href="/zh/advanced-links.html" aria-label="简体中文"><!---->简体中文<!----></a></li></ul></button></div></div><div class="vp-nav-item vp-action"><a class="vp-action-link" href="https://github.com/mdit-plugins/mdit-plugins" target="_blank" rel="noopener noreferrer" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" class="icon github-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="github icon" name="github" style="width:1.25rem;height:1.25rem;vertical-align:middle;"><path d="M511.957 21.333C241.024 21.333 21.333 240.981 21.333 512c0 216.832 140.544 400.725 335.574 465.664 24.49 4.395 32.256-10.07 32.256-23.083 0-11.69.256-44.245 0-85.205-136.448 29.61-164.736-64.64-164.736-64.64-22.315-56.704-54.4-71.765-54.4-71.765-44.587-30.464 3.285-29.824 3.285-29.824 49.195 3.413 75.179 50.517 75.179 50.517 43.776 75.008 114.816 53.333 142.762 40.79 4.523-31.66 17.152-53.377 31.19-65.537-108.971-12.458-223.488-54.485-223.488-242.602 0-53.547 19.114-97.323 50.517-131.67-5.035-12.33-21.93-62.293 4.779-129.834 0 0 41.258-13.184 134.912 50.346a469.803 469.803 0 0 1 122.88-16.554c41.642.213 83.626 5.632 122.88 16.554 93.653-63.488 134.784-50.346 134.784-50.346 26.752 67.541 9.898 117.504 4.864 129.834 31.402 34.347 50.474 78.123 50.474 131.67 0 188.586-114.73 230.016-224.042 242.09 17.578 15.232 33.578 44.672 33.578 90.454v135.85c0 13.142 7.936 27.606 32.854 22.87C862.25 912.597 1002.667 728.747 1002.667 512c0-271.019-219.648-490.667-490.71-490.667z"></path></svg></a></div><div class="vp-nav-item hide-in-mobile"><button type="button" class="vp-color-mode-switch" id="color-mode-switch"><svg xmlns="http://www.w3.org/2000/svg" class="icon auto-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="auto icon" name="auto" style="display:block;"><path d="M512 992C246.92 992 32 777.08 32 512S246.92 32 512 32s480 214.92 480 480-214.92 480-480 480zm0-840c-198.78 0-360 161.22-360 360 0 198.84 161.22 360 360 360s360-161.16 360-360c0-198.78-161.22-360-360-360zm0 660V212c165.72 0 300 134.34 300 300 0 165.72-134.28 300-300 300z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" class="icon dark-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="dark icon" name="dark" style="display:none;"><path d="M524.8 938.667h-4.267a439.893 439.893 0 0 1-313.173-134.4 446.293 446.293 0 0 1-11.093-597.334A432.213 432.213 0 0 1 366.933 90.027a42.667 42.667 0 0 1 45.227 9.386 42.667 42.667 0 0 1 10.24 42.667 358.4 358.4 0 0 0 82.773 375.893 361.387 361.387 0 0 0 376.747 82.774 42.667 42.667 0 0 1 54.187 55.04 433.493 433.493 0 0 1-99.84 154.88 438.613 438.613 0 0 1-311.467 128z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" class="icon light-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="light icon" name="light" style="display:none;"><path d="M952 552h-80a40 40 0 0 1 0-80h80a40 40 0 0 1 0 80zM801.88 280.08a41 41 0 0 1-57.96-57.96l57.96-58a41.04 41.04 0 0 1 58 58l-58 57.96zM512 752a240 240 0 1 1 0-480 240 240 0 0 1 0 480zm0-560a40 40 0 0 1-40-40V72a40 40 0 0 1 80 0v80a40 40 0 0 1-40 40zm-289.88 88.08-58-57.96a41.04 41.04 0 0 1 58-58l57.96 58a41 41 0 0 1-57.96 57.96zM192 512a40 40 0 0 1-40 40H72a40 40 0 0 1 0-80h80a40 40 0 0 1 40 40zm30.12 231.92a41 41 0 0 1 57.96 57.96l-57.96 58a41.04 41.04 0 0 1-58-58l58-57.96zM512 832a40 40 0 0 1 40 40v80a40 40 0 0 1-80 0v-80a40 40 0 0 1 40-40zm289.88-88.08 58 57.96a41.04 41.04 0 0 1-58 58l-57.96-58a41 41 0 0 1 57.96-57.96z"></path></svg></button></div><!--[--><div id="docsearch-container" style="display:none;"></div><div class="docsearch-placeholder"><button type="button" aria-label="Search" aria-keyshortcuts="Control+k" class="DocSearch DocSearch-Button"><span class="DocSearch-Button-Container"><svg width="20" height="20" viewBox="0 0 24 24" aria-hidden="true" class="DocSearch-Search-Icon"><circle cx="11" cy="11" r="8" stroke="currentColor" fill="none" stroke-width="1.4"></circle><path d="m21 21-4.3-4.3" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key DocSearch-Button-Key--ctrl">Ctrl</kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--><!--]--><button type="button" class="vp-toggle-navbar-button" aria-label="Toggle Navbar" aria-expanded="false" aria-controls="nav-screen"><span><span class="vp-top"></span><span class="vp-middle"></span><span class="vp-bottom"></span></span></button></div></header><!----><!--]--><!----><div class="toggle-sidebar-wrapper"><span class="arrow start"></span></div><aside id="sidebar" class="vp-sidebar" vp-sidebar><!----><ul class="vp-sidebar-links"><li><a class="route-link auto-link vp-sidebar-link" href="/" aria-label="home"><!--[--><i class="vp-icon fas fa-home" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->home<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/abbr.html" aria-label="plugin-abbr"><!--[--><i class="vp-icon fas fa-spell-check" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-abbr<!----></a></li><li><a class="route-link route-link-active auto-link vp-sidebar-link active" href="/advanced-links.html" aria-label="plugin-advanced-links"><!--[--><i class="vp-icon fas fa-paperclip" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-advanced-links<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/alert.html" aria-label="plugin-alert"><!--[--><i class="vp-icon fas fa-bell" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-alert<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/align.html" aria-label="plugin-align"><!--[--><i class="vp-icon fas fa-align-center" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-align<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/anchor.html" aria-label="plugin-anchor"><!--[--><i class="vp-icon fas fa-anchor" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-anchor<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/attrs.html" aria-label="plugin-attrs"><!--[--><i class="vp-icon fas fa-tags" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-attrs<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/container.html" aria-label="plugin-container"><!--[--><i class="vp-icon fas fa-box-open" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-container<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/demo.html" aria-label="plugin-demo"><!--[--><i class="vp-icon fas fa-lightbulb" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-demo<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/dl.html" aria-label="plugin-dl"><!--[--><i class="vp-icon fas fa-book" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-dl<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/embed.html" aria-label="plugin-embed"><!--[--><i class="vp-icon fas fa-code" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-embed<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/emoji.html" aria-label="plugin-emoji"><!--[--><i class="vp-icon fas fa-face-smile" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-emoji<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/field.html" aria-label="plugin-field"><!--[--><i class="vp-icon fas fa-table-list" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-field<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/figure.html" aria-label="plugin-figure"><!--[--><i class="vp-icon fas fa-image" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-figure<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/footnote.html" aria-label="plugin-footnote"><!--[--><i class="vp-icon fas fa-quote-left" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-footnote<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/icon.html" aria-label="plugin-icon"><!--[--><i class="vp-icon fas fa-icons" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-icon<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/img-lazyload.html" aria-label="plugin-img-lazyload"><!--[--><i class="vp-icon fas fa-spinner" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-img-lazyload<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/img-mark.html" aria-label="plugin-img-mark"><!--[--><i class="vp-icon fas fa-circle-half-stroke" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-img-mark<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/img-size.html" aria-label="plugin-img-size"><!--[--><i class="vp-icon fas fa-up-right-and-down-left-from-center" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-img-size<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/include.html" aria-label="plugin-include"><!--[--><i class="vp-icon fas fa-file-import" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-include<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/inline-rule.html" aria-label="plugin-inline-rule"><!--[--><i class="vp-icon fas fa-wand-magic-sparkles" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-inline-rule<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/ins.html" aria-label="plugin-ins"><!--[--><i class="vp-icon fas fa-underline" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-ins<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/katex.html" aria-label="plugin-katex"><!--[--><i class="vp-icon fas fa-square-root-variable" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-katex<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/layout.html" aria-label="plugin-layout"><!--[--><i class="vp-icon fas fa-table-cells-large" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-layout<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/mark.html" aria-label="plugin-mark"><!--[--><i class="vp-icon fas fa-highlighter" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-mark<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/mathjax.html" aria-label="plugin-mathjax"><!--[--><i class="vp-icon fas fa-square-root-variable" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-mathjax<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/plantuml.html" aria-label="plugin-plantuml"><!--[--><i class="vp-icon fas fa-diagram-project" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-plantuml<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/ruby.html" aria-label="plugin-ruby"><!--[--><i class="vp-icon fas fa-language" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-ruby<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/snippet.html" aria-label="plugin-snippet"><!--[--><i class="vp-icon fas fa-file-code" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-snippet<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/spoiler.html" aria-label="plugin-spoiler"><!--[--><i class="vp-icon fas fa-eraser" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-spoiler<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/stylize.html" aria-label="plugin-stylize"><!--[--><i class="vp-icon fas fa-palette" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-stylize<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/sub.html" aria-label="plugin-sub"><!--[--><i class="vp-icon fas fa-subscript" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-sub<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/sup.html" aria-label="plugin-sup"><!--[--><i class="vp-icon fas fa-superscript" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-sup<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/tab.html" aria-label="plugin-tab"><!--[--><i class="vp-icon fas fa-table-columns" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-tab<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/tasklist.html" aria-label="plugin-tasklist"><!--[--><i class="vp-icon fas fa-list-check" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-tasklist<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/tex.html" aria-label="plugin-tex"><!--[--><i class="vp-icon fas fa-square-root-variable" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-tex<!----></a></li><li><a class="route-link auto-link vp-sidebar-link" href="/uml.html" aria-label="plugin-uml"><!--[--><i class="vp-icon fas fa-scissors" sizing="both" style="--icon-width:1.25em;--fa-width:1.25em;"></i><!--]-->plugin-uml<!----></a></li></ul><!----></aside><!--[--><main id="main-content" class="vp-page"><!--[--><!----><!----><nav class="vp-breadcrumb disable"></nav><div class="vp-page-title"><h1><i class="vp-icon fas fa-paperclip" sizing="height"></i>@mdit/plugin-advanced-links</h1><!----><hr></div><!----><div class="" vp-content><!----><div id="markdown-content"><p>Register custom <code>@[name ...props](link)</code> syntax with your own renderer.</p><!-- more --><h2 id="usage" tabindex="-1"><a class="header-anchor" href="#usage"><span>Usage</span></a></h2><div class="vp-code-tabs"><div class="vp-code-tabs-nav" role="tablist"><button type="button" class="vp-code-tab-nav active" role="tab" aria-controls="v-0" aria-selected="true">TS</button><button type="button" class="vp-code-tab-nav" role="tab" aria-controls="v-1" aria-selected="false">JS</button></div><!--[--><div class="vp-code-tab active" id="v-0" role="tabpanel" aria-expanded="true"><div class="vp-code-tab-title">TS</div><!--[--><div class="language-ts line-numbers-mode" data-highlighter="shiki" data-ext="ts" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-ts"><span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">import</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> { </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">advancedLinks</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> } </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">from</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> "@mdit/plugin-advanced-links"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">import</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;"> MarkdownIt</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;"> from</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> "markdown-it"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">const</span><span style="--shiki-light:#986801;--shiki-dark:#E5C07B;"> md</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2;"> =</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;"> new</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;"> MarkdownIt</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">()</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> .</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;">use</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#E06C75;">advancedLinks</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, {</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;"> name</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> "video"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">,</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;"> renderer</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> (</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">link</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, </span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">props</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">) </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">=></span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> `<video src="</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">${</span><span style="--shiki-light:#383A42;--shiki-dark:#E06C75;">link</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;">" controls</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">${</span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B;">props</span><span style="--shiki-light:#50A14F;--shiki-dark:#ABB2BF;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">autoplay</span><span style="--shiki-light:#0184BC;--shiki-dark:#C678DD;"> ?</span><span style="--shiki-light:#CA1243;--shiki-dark:#98C379;"> "</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> autoplay</span><span style="--shiki-light:#CA1243;--shiki-dark:#98C379;">"</span><span style="--shiki-light:#0184BC;--shiki-dark:#C678DD;"> :</span><span style="--shiki-light:#CA1243;--shiki-dark:#98C379;"> ""</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;">></video>`</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> })</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> .</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;">use</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#E06C75;">advancedLinks</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, {</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;"> name</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> "badge"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;"> inline</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66;"> true</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">,</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;"> renderer</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> (</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">link</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, </span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">props</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">) </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">=></span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> `<span class="badge badge-</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">${</span><span style="--shiki-light:#383A42;--shiki-dark:#E06C75;">link</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;">"></span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">${</span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B;">props</span><span style="--shiki-light:#50A14F;--shiki-dark:#ABB2BF;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">text</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2;"> ||</span><span style="--shiki-light:#383A42;--shiki-dark:#E06C75;"> link</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"></span>`</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> });</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><!--]--></div><div class="vp-code-tab" id="v-1" role="tabpanel" aria-expanded="false"><div class="vp-code-tab-title">JS</div><!--[--><div class="language-js line-numbers-mode" data-highlighter="shiki" data-ext="js" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-js"><span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">import</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> { </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">advancedLinks</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> } </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">from</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> "@mdit/plugin-advanced-links"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">;</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">import</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;"> MarkdownIt</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;"> from</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> "markdown-it"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">const</span><span style="--shiki-light:#986801;--shiki-dark:#E5C07B;"> md</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2;"> =</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;"> new</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;"> MarkdownIt</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">()</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> .</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;">use</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#E06C75;">advancedLinks</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, {</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;"> name</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> "video"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">,</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;"> renderer</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> (</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">link</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, </span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">props</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">) </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">=></span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> `<video src="</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">${</span><span style="--shiki-light:#383A42;--shiki-dark:#E06C75;">link</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;">" controls</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">${</span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B;">props</span><span style="--shiki-light:#50A14F;--shiki-dark:#ABB2BF;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">autoplay</span><span style="--shiki-light:#0184BC;--shiki-dark:#C678DD;"> ?</span><span style="--shiki-light:#CA1243;--shiki-dark:#98C379;"> "</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> autoplay</span><span style="--shiki-light:#CA1243;--shiki-dark:#98C379;">"</span><span style="--shiki-light:#0184BC;--shiki-dark:#C678DD;"> :</span><span style="--shiki-light:#CA1243;--shiki-dark:#98C379;"> ""</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;">></video>`</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> })</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> .</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;">use</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">(</span><span style="--shiki-light:#383A42;--shiki-dark:#E06C75;">advancedLinks</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, {</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;"> name</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> "badge"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;"> inline</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66;"> true</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">,</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;"> renderer</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> (</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">link</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, </span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">props</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">) </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">=></span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"> `<span class="badge badge-</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">${</span><span style="--shiki-light:#383A42;--shiki-dark:#E06C75;">link</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;">"></span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">${</span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B;">props</span><span style="--shiki-light:#50A14F;--shiki-dark:#ABB2BF;">.</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">text</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2;"> ||</span><span style="--shiki-light:#383A42;--shiki-dark:#E06C75;"> link</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD;">}</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;"></span>`</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> });</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><!--]--></div><!--]--></div><p>The plugin can be used as many times as you need, each call registers one <code>name</code>.</p><h2 id="syntax" tabindex="-1"><a class="header-anchor" href="#syntax"><span>Syntax</span></a></h2><div class="language-md" data-highlighter="shiki" data-ext="md" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-md"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">@</span><span style="--shiki-light:#986801;--shiki-dark:#ABB2BF;">[</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;">name ...props</span><span style="--shiki-light:#986801;--shiki-dark:#ABB2BF;">]</span><span style="--shiki-light:#A626A4;--shiki-dark:#E06C75;">(</span><span style="--shiki-light:#A626A4;--shiki-light-text-decoration:inherit;--shiki-dark:#C678DD;--shiki-dark-text-decoration:underline;">link</span><span style="--shiki-light:#A626A4;--shiki-dark:#E06C75;">)</span></span></code></pre></div><ul><li><code>name</code> is the registered identifier, it must be followed by a whitespace or <code>]</code></li><li><code>props</code> are optional, and can be written as <code>key</code>, <code>key=value</code>, <code>key="value"</code> or <code>key='value'</code></li><li><code>link</code> is the link destination</li></ul><p>Props are parsed into an object:</p><ul><li>A prop without a value is <code>true</code>, e.g. <code>@[video autoplay](a.mp4)</code> gives <code>{ autoplay: true }</code></li><li>A prop with a value keeps the value as a string, e.g. <code>@[video title=Hello](a.mp4)</code> gives <code>{ title: "Hello" }</code></li><li>A repeated key keeps the last value, e.g. <code>@[video a=1 a=2](a.mp4)</code> gives <code>{ a: "2" }</code></li></ul><h3 id="escaping" tabindex="-1"><a class="header-anchor" href="#escaping"><span>Escaping</span></a></h3><p>Most props are plain values. When a value contains a whitespace, <code>]</code> or <code>=</code>, wrap it in quotes:</p><div class="language-md" data-highlighter="shiki" data-ext="md" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-md"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">@[video title="Hello world" caption="1]2"](a.mp4)</span></span></code></pre></div><p>A key cannot be quoted, and <code>]</code> ends the props, so escape them with <code>\</code>:</p><div class="language-md" data-highlighter="shiki" data-ext="md" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-md"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">@</span><span style="--shiki-light:#986801;--shiki-dark:#ABB2BF;">[</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;">video a\ b=1</span><span style="--shiki-light:#986801;--shiki-dark:#ABB2BF;">]</span><span style="--shiki-light:#A626A4;--shiki-dark:#E06C75;">(</span><span style="--shiki-light:#A626A4;--shiki-light-text-decoration:inherit;--shiki-dark:#C678DD;--shiki-dark-text-decoration:underline;">a.mp4</span><span style="--shiki-light:#A626A4;--shiki-dark:#E06C75;">)</span></span></code></pre></div><p><code>\</code> also escapes <code>]</code>, <code>=</code> and itself (<code>\\</code>), in keys as well as values. The full rules are folded below.</p><details class="hint-container details"><summary>Syntax details</summary><p>A prop is <code>key</code>, <code>key=value</code>, <code>key="value"</code> or <code>key='value'</code>.</p><p>Tokenization:</p><ul><li>Whitespaces separate props, and the props end at the <code>]</code> that closes the syntax.</li><li>A key ends with the first whitespace or <code>=</code>, and it must not be empty, so <code>@[video =1](a.mp4)</code> is unmatched.</li><li>After <code>=</code>, a <code>"</code> or <code>'</code> opens a quoted value, which ends with the matching quote only, so it may contain whitespaces, <code>]</code> and <code>=</code>.</li><li>Otherwise the value is unquoted, and ends with the next whitespace or <code>]</code>. It may contain <code>=</code>, so <code>@[video a=b=c](a.mp4)</code> gives <code>{ a: "b=c" }</code>.</li></ul><p>Escapes:</p><ul><li><code>\</code> escapes the next character in keys and values, and the escaped character is taken literally.</li><li>A <code>]</code> outside a quoted value must be escaped: <code>@[video title=1\]2](a.mp4)</code> gives <code>{ title: "1]2" }</code>.</li><li>A whitespace and <code>=</code> can be part of a key or an unquoted value when escaped: <code>@[video a\ b=c\ d](a.mp4)</code> gives <code>{ "a b": "c d" }</code>, and <code>@[video a\=b](a.mp4)</code> gives <code>{ "a=b": true }</code>.</li><li><code>\</code> itself is written as <code>\\</code>, and a <code>\</code> at the end of the props or right before a line break is malformed.</li></ul><p>Quotes:</p><ul><li>A quote opens a quoted value right after <code>=</code> only. Elsewhere it is a plain character, so <code>@[video a=it's](a.mp4)</code> gives <code>{ a: "it's" }</code>.</li><li>Because of that, <code>@[video a= 'x'](a.mp4)</code> gives <code>{ a: "", "'x'": true }</code>.</li><li>The same escapes apply inside a quoted value, so <code>@[video a="x\"y"](a.mp4)</code> gives <code>{ a: 'x"y' }</code>.</li></ul><p>Prop names:</p><ul><li>Names are kept as-is apart from <code>\</code> escapes: they are not lowercased, quote-stripped or entity-decoded, so <code>@[video 'a' b](x)</code> gives <code>{ "'a'": true, b: true }</code>.</li><li><code>__proto__</code> is ignored, since assigning it does not create an own property.</li></ul><p>Link:</p><ul><li>The link is not normalized nor validated, unlike a normal Markdown link: MarkdownIt resolves its backslash escapes and HTML entities, but the result is neither percent-encoded nor checked.</li></ul><p>Limits:</p><ul><li>Props cannot span lines.</li><li>Props are not entity-decoded, so <code>@[video a=&amp;](a.mp4)</code> gives <code>{ a: "&amp;" }</code>.</li><li>Malformed props, such as an empty key, a dangling <code>\</code> or an unterminated quoted value, make the whole syntax unmatched, then the text is handled by other rules, e.g. <code>@[test a=1 = b=2](x)</code> is rendered as a normal link.</li></ul></details><p>The name must not be empty or contain whitespace, <code>[</code>, <code>]</code>, <code>(</code>, <code>)</code>, <code>"</code> or <code>'</code>, otherwise the plugin throws an error. Names are matched exactly, and an unregistered name is left to other rules, so <code>@[unknown](x)</code> is rendered as a normal link.</p><p>The link is passed to the renderer without normalization or validation, so escape and validate it yourself when generating HTML. A title in the destination (<code>@[video](a.mp4 "title")</code>) is not supported, use a prop instead.</p><div class="hint-container tip"><p class="hint-container-title">Syntax as plain text</p><p>To keep the syntax as plain text, escape the <code>[</code>, or use a code span:</p><div class="language-md" data-highlighter="shiki" data-ext="md" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-md"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">@</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2;">\[</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">video](a.mp4)</span></span></code></pre></div><p>Escaping the <code>@</code> alone is not enough: the rest is then a normal Markdown link, e.g. <code>\@[video](a.mp4)</code> renders as <code>@</code> followed by a link to <code>a.mp4</code>.</p></div><h3 id="block-and-inline" tabindex="-1"><a class="header-anchor" href="#block-and-inline"><span>Block and inline</span></a></h3><p>By default the syntax is only valid as a block, and it must occupy the whole line.</p><p>Set <code>inline: true</code> to also allow it in a paragraph. When such syntax occupies the whole line, it is still rendered as a block, so no <code><p></code> is generated.</p><p>A block syntax cannot interrupt a setext heading underline, so a line starting with <code>===</code> or <code>---</code> turns the previous block into a heading instead.</p><h2 id="options" tabindex="-1"><a class="header-anchor" href="#options"><span>Options</span></a></h2><div class="vp-fields"><div class="vp-field"><div class="vp-field-header"><span class="vp-field-name" id="name">name</span><span class="vp-field-badges"><span class="vp-field-required">Required</span></span><code class="vp-field-type">string</code></div><div class="vp-field-description"><p>Name used by the syntax. It must not be empty or contain whitespace, <code>[</code>, <code>]</code>, <code>(</code>, <code>)</code>, <code>"</code> or <code>'</code>. Registering the same name again replaces the previous config.</p></div></div><div class="vp-field"><div class="vp-field-header"><span class="vp-field-name" id="renderer">renderer</span><span class="vp-field-badges"><span class="vp-field-required">Required</span></span><code class="vp-field-type">(link: string, props: AdvancedLinkProps, env: unknown) => string</code></div><div class="vp-field-description"><div class="language-ts" data-highlighter="shiki" data-ext="ts" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-ts"><span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">type</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B;"> AdvancedLinkProps</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2;"> =</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B;"> Record</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"><</span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B;">string</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, </span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B;">string</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;"> |</span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B;"> true</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">>;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">type</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B;"> AdvancedLinkRenderer</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2;"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> (</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">link</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#0184BC;--shiki-dark:#E5C07B;"> string</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, </span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">props</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B;"> AdvancedLinkProps</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">, </span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic;">env</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF;">:</span><span style="--shiki-light:#0184BC;--shiki-dark:#E5C07B;"> unknown</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">) </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD;">=></span><span style="--shiki-light:#0184BC;--shiki-dark:#E5C07B;"> string</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">;</span></span></code></pre></div><p>Renderer to generate HTML. <code>env</code> is the MarkdownIt environment. The link is passed without normalization or validation.</p></div></div><div class="vp-field"><div class="vp-field-header"><span class="vp-field-name" id="inline">inline</span><code class="vp-field-type">boolean</code></div><div class="vp-field-description"><p>Whether the syntax is also available inline.</p></div></div></div><h2 id="examples" tabindex="-1"><a class="header-anchor" href="#examples"><span>Examples</span></a></h2><p>With the usage example above:</p><p><strong>Input:</strong></p><div class="language-md" data-highlighter="shiki" data-ext="md" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-md"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">@</span><span style="--shiki-light:#986801;--shiki-dark:#ABB2BF;">[</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;">video</span><span style="--shiki-light:#986801;--shiki-dark:#ABB2BF;">]</span><span style="--shiki-light:#A626A4;--shiki-dark:#E06C75;">(</span><span style="--shiki-light:#A626A4;--shiki-light-text-decoration:inherit;--shiki-dark:#C678DD;--shiki-dark-text-decoration:underline;">a.mp4</span><span style="--shiki-light:#A626A4;--shiki-dark:#E06C75;">)</span></span></code></pre></div><p><strong>Output:</strong></p><div class="language-html" data-highlighter="shiki" data-ext="html" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-html"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"><</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">video</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66;"> src</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;">"a.mp4"</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66;"> controls</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">></</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">video</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">></span></span></code></pre></div><p><strong>Input:</strong></p><div class="language-md" data-highlighter="shiki" data-ext="md" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-md"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">@</span><span style="--shiki-light:#986801;--shiki-dark:#ABB2BF;">[</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;">video autoplay</span><span style="--shiki-light:#986801;--shiki-dark:#ABB2BF;">]</span><span style="--shiki-light:#A626A4;--shiki-dark:#E06C75;">(</span><span style="--shiki-light:#A626A4;--shiki-light-text-decoration:inherit;--shiki-dark:#C678DD;--shiki-dark-text-decoration:underline;">a.mp4</span><span style="--shiki-light:#A626A4;--shiki-dark:#E06C75;">)</span></span></code></pre></div><p><strong>Output:</strong></p><div class="language-html" data-highlighter="shiki" data-ext="html" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-html"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"><</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">video</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66;"> src</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;">"a.mp4"</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66;"> controls</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66;"> autoplay</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">></</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">video</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">></span></span></code></pre></div><p><strong>Input:</strong></p><div class="language-md" data-highlighter="shiki" data-ext="md" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-md"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">Go to @</span><span style="--shiki-light:#986801;--shiki-dark:#ABB2BF;">[</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF;">badge primary text="home page"</span><span style="--shiki-light:#986801;--shiki-dark:#ABB2BF;">]</span><span style="--shiki-light:#A626A4;--shiki-dark:#E06C75;">(</span><span style="--shiki-light:#A626A4;--shiki-light-text-decoration:inherit;--shiki-dark:#C678DD;--shiki-dark-text-decoration:underline;">home</span><span style="--shiki-light:#A626A4;--shiki-dark:#E06C75;">)</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"> now.</span></span></code></pre></div><p><strong>Output:</strong></p><div class="language-html" data-highlighter="shiki" data-ext="html" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34;"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-html"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;"><</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">p</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">>Go to <</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">span</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66;"> class</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379;">"badge badge-home"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">>home page</</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">span</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">> now.</</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75;">p</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF;">></span></span></code></pre></div></div><!----><!----><!----></div><footer class="vp-page-meta"><div class="vp-meta-item edit-link"><a class="auto-link external-link vp-meta-label" href="https://github.com/mdit-plugins/mdit-plugins/edit/main/docs/src/advanced-links.md" aria-label="Edit this page" rel="noopener noreferrer" target="_blank"><!--[--><svg xmlns="http://www.w3.org/2000/svg" class="icon edit-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="edit icon" name="edit"><path d="M430.818 653.65a60.46 60.46 0 0 1-50.96-93.281l71.69-114.012 7.773-10.365L816.038 80.138A60.46 60.46 0 0 1 859.225 62a60.46 60.46 0 0 1 43.186 18.138l43.186 43.186a60.46 60.46 0 0 1 0 86.373L588.879 565.55l-8.637 8.637-117.466 68.234a60.46 60.46 0 0 1-31.958 11.229z"></path><path d="M728.802 962H252.891A190.883 190.883 0 0 1 62.008 771.98V296.934a190.883 190.883 0 0 1 190.883-192.61h267.754a60.46 60.46 0 0 1 0 120.92H252.891a69.962 69.962 0 0 0-69.098 69.099V771.98a69.962 69.962 0 0 0 69.098 69.098h475.911A69.962 69.962 0 0 0 797.9 771.98V503.363a60.46 60.46 0 1 1 120.922 0V771.98A190.883 190.883 0 0 1 728.802 962z"></path></svg><!--]-->Edit this page<!----></a></div><div class="vp-meta-item git-info"><div class="update-time"><span class="vp-meta-label">Last Updated: </span><time class="vp-meta-info" datetime="2026-10-13T07:38:21.000Z" data-allow-mismatch>10/13/26, 7:38 AM</time></div><!----></div></footer><nav class="vp-page-nav"><a class="route-link auto-link prev" href="/abbr.html" aria-label="plugin-abbr"><div class="hint"><span class="arrow start"></span>Prev</div><div class="link"><i class="vp-icon fas fa-spell-check" sizing="height"></i>plugin-abbr</div></a><a class="route-link auto-link next" href="/alert.html" aria-label="plugin-alert"><div class="hint">Next<span class="arrow end"></span></div><div class="link">plugin-alert<i class="vp-icon fas fa-bell" sizing="height"></i></div></a></nav><div id="comment" class="giscus-wrapper input-top vp-comment" vp-comment style="display:block;"><div style="display: flex;align-items: center;justify-content: center;height: 96px"><span style="--loading-icon: url("data:image/svg+xml;charset=utf8,%3Csvg preserveAspectRatio=%22xMidYMid%22 viewBox=%2225 25 50 50%22%3E%3CanimateTransform attributeName=%22transform%22 type=%22rotate%22 dur=%222s%22 keyTimes=%220;1%22 repeatCount=%22indefinite%22 values=%220;360%22%3E%3C/animateTransform%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2220%22 fill=%22none%22 stroke=%22currentColor%22 stroke-width=%224%22 stroke-linecap=%22round%22%3E%3Canimate attributeName=%22stroke-dasharray%22 dur=%221.5s%22 keyTimes=%220;0.5;1%22 repeatCount=%22indefinite%22 values=%221,200;90,200;1,200%22%3E%3C/animate%3E%3Canimate attributeName=%22stroke-dashoffset%22 dur=%221.5s%22 keyTimes=%220;0.5;1%22 repeatCount=%22indefinite%22 values=%220;-35px;-125px%22%3E%3C/animate%3E%3C/circle%3E%3C/svg%3E");--icon-size: 48px;display: inline-block;width: var(--icon-size);height: var(--icon-size);background-color: currentcolor;-webkit-mask-image: var(--loading-icon);mask-image: var(--loading-icon)"></span></div></div><!----><!--]--></main><!--]--><footer class="vp-footer-wrapper" vp-footer><div class="vp-footer">Docs by <a href="https://theme-hope.vuejs.press/" target="_blank">VuePress Theme Hope</a></div><div class="vp-copyright">MIT LICENSE | Copyright © 2022-present Mr.Hope</div></footer></div><!--]--><!--]--><!--[--><!----><!--[--><!--]--><!--]--><!--]--></div>
<script type="module" src="/assets/app-Ddwr36KU.js" defer></script>
</body>
</html>