fix(fontawesome): keep spaces on both sides of the fontawesome i… (#178)

This commit is contained in:
Dillon
2020-03-17 11:03:58 +08:00
committed by GitHub
parent 80db783396
commit f9dba2e36c

View File

@@ -1,5 +1,14 @@
{{- /* Font Awesome */ -}}
{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw"></i> */ -}}
{{- $REin := `:\(([\w- ]+?)\):` -}}
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
{{- return replaceRE $REin $REout . -}}
{{- $REin := ` (:\([\w- ]+?\):)` -}}
{{- $REout := `&nbsp;$1` -}}
{{- $content := replaceRE $REin $REout . -}}
{{- $REin = `(:\([\w- ]+?\):) ` -}}
{{- $REout = `$1&nbsp;` -}}
{{- $content = replaceRE $REin $REout . -}}
{{- $REin = `:\(([\w- ]+?)\):` -}}
{{- $REout = `<i class="$1 fa-fw"></i>` -}}
{{- return replaceRE $REin $REout $content -}}