SmartSymbols
Overview
SmartSymbols 添加了用于创建特殊字符的语法,如商标、箭头、分数等。
它基本上允许更多"smarty-pants"之类的替代品。 它的目的是与 Python Markdown 的smarty
扩展一起使用,而不是取代。
Markdown | Result |
---|---|
(tm) | ™ |
(c) | © |
(r) | ® |
c/o | ℅ |
+/- | ± |
--> | → |
<-- | ← |
<--> | ↔ |
=/= | ≠ |
1/4, etc. | ¼, etc. |
1st 2nd etc. | 1st 2nd etc. |
The SmartSymbols extension can be included in Python Markdown by using the following:
import markdown
md = markdown.Markdown(extensions=['pymdownx.smartsymbols'])
Options
Option | Type | Default | Description |
---|---|---|---|
trademark | bool | True | Add syntax for trademark symbol. |
copyright | bool | True | Add syntax for copyright symbol. |
registered | bool | True | Add syntax for registered symbol. |
care_of | bool | True | Add syntax for care / of. |
plusminus | bool | True | Add syntax for plus / minus. |
arrows | bool | True | Add syntax for creating arrows. |
notequal | bool | True | Add syntax for not equal symbol. |
fractions | bool | True | Add syntax for common fractions. |
ordinal_numbers | bool | True | Add syntax for ordinal numbers. |
最后更新: January 1, 2023