summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicholasjohnson.ch>2024-05-02 00:00:00 +0000
committerNicholas Johnson <nick@nicholasjohnson.ch>2024-05-02 00:00:00 +0000
commitb872ebadbb64c755f60f867acaa373e9109c0256713891c92dfbdb362dd5dbcf (patch)
tree105b0bc8bc03dc59c396f088aa9239db924d56ddf1d5955445be5fa8ea6b4d6d
parent2edd4b1e19403ac267aebff3221c611ba8a05d04fc27be84d099da235cd06793 (diff)
downloadhugo-theme-journal-1.2.5.tar.gz
hugo-theme-journal-1.2.5.zip
Give rationale for bold/italics codev1.2.5
-rw-r--r--layouts/_default/single.gmi1
1 files changed, 1 insertions, 0 deletions
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi
index fdadecb..b871d67 100644
--- a/layouts/_default/single.gmi
+++ b/layouts/_default/single.gmi
@@ -73,6 +73,7 @@
{{ $rendered_text = $rendered_text | replaceRE `(?m)^[\t ]*(\S.+?)[\t ]*\n\-+$` "## $1" -}}
{{/* remove bold and italics asterisk symbols */ -}}
+ {{/* note: this operation is performed in 3 steps to handle nested bold and italics */ -}}
{{ $rendered_text = $rendered_text | replaceRE `\*{3}(\S(?:.*\S)?)\*{3}` "$1" -}}
{{ $rendered_text = $rendered_text | replaceRE `\*{2}(\S(?:.*\S)?)\*{2}` "$1" -}}
{{ $rendered_text = $rendered_text | replaceRE `\*{1}(\S(?:.*\S)?)\*{1}` "$1" -}}