feat(syntax): add fraction syntax (#181)

* feat(syntax): add fraction syntax

* docs: add remind for Hugo extended version
This commit is contained in:
Dillon
2020-03-18 00:52:36 +08:00
committed by GitHub
parent 01d814ef6f
commit 84d48f37dc
19 changed files with 104 additions and 24 deletions

View File

@@ -0,0 +1,5 @@
{{- /* Fraction */ -}}
{{- /* [A]/[B] -> <sup>A</sup>/<sub>B</sub> */ -}}
{{- $REin := `\[(.+?)\]/\[(.+?)\]` -}}
{{- $REout := `<sup>$1</sup>/<sub>$2</sub>` -}}
{{- return replaceRE $REin $REout . -}}