跳至主要內容

上下角标

小于 1 分钟MarkdownMarkdown上下角标

让你的 VuePress 站点中的 Markdown 文件支持上下角标。

配置

TS
import { defineUserConfig } from "vuepress";
import { hopeTheme } from "vuepress-theme-hope";

export default defineUserConfig({
  theme: hopeTheme({
    plugins: {
      mdEnhance: {
        // 启用下角标功能
        sub: true,
        // 启用上角标
        sup: true,
      },
    },
  }),
});







 
 
 
 
 
 


语法

  • 使用^ ^进行上角标标注。
  • 使用~ ~进行下角标标注。
案例
  • 19th
  • H2O
- 19^th^
- H~2~O
转义

你可以使用 \ 来转义 ^~:

H~2~O 19^th^

你可以使用 `\` 来转义 `^``~`:

H\~2~O 19\^th^