@mdit/plugin-abbr
支持缩写词 <abbr>
标签的插件。
使用
TS
import MarkdownIt from "markdown-it";
import { abbr } from "@mdit/plugin-abbr";
const mdIt = MarkdownIt().use(abbr);
mdIt.render(`
*[HTML]: Hyper Text Markup Language
*[W3C]: World Wide Web Consortium
The HTML specification is maintained by the W3C.
`);
JS
const MarkdownIt = require("markdown-it");
const { abbr } = require("@mdit/plugin-abbr");
const mdIt = MarkdownIt().use(abbr);
mdIt.render(`
*[HTML]: Hyper Text Markup Language
*[W3C]: World Wide Web Consortium
The HTML specification is maintained by the W3C.
`);
语法
通过此插件,你可以通过以额外 *
开头的链接声明来声明缩略词。
*[缩略词]: 内容
转移
转义可以通过添加额外的 \
以转义 *
[
或 ]
字符:
\*[文字]: 内容
will be
*[文字]: 内容
示例
示例
The HTML specificationis maintained by the W3C.
*[HTML]: Hyper Text Markup Language
*[W3C]: World Wide Web Consortium
The HTML specificationis maintained by the W3C.