Tilde
Overview
波浪号可选地添加了两个不同的特征,这些特征在语法上围绕~字符构建: delete 插入 <del></del> 标记和subscript 插入 <sub></sub> 标记.
波浪号扩展可以通过以下方式包含在 Python Markdown 中:
import markdown
md = markdown.Markdown(extensions=['pymdownx.tilde'])
Delete
要将内容包装在 delete 标记中,只需用两个 ~ 将文本环绕起来。 您也可以在选项中启用 smart_delete . 智能 删除 行为的模型BetterEm.
Delete Example
Delete me
~~Delete me~~
Subscript
To denote a subscript, you can surround the desired content in single ~. It uses Pandoc style logic, so if your subscript needs to have spaces, you must escape the spaces.
Subscript Example
CH3CH2OH
texta subscript
CH~3~CH~2~OH
text~a\ subscript~
Options
| Option | Type | Default | Description |
|---|---|---|---|
smart_delete | bool | True | Use smart logic with delete characters. |
delete | bool | True | Enable delete feature. |
subscript | bool | True | Enable subscript feature. |
最后更新: January 1, 2023