aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicholasjohnson.ch>2023-01-22 00:00:00 +0000
committerNicholas Johnson <nick@nicholasjohnson.ch>2023-01-22 00:00:00 +0000
commitb073e35b942de7cdf78abde8f7bbd1439f37d8220412ad9a3907f9da0e6c93a7 (patch)
tree4b42f764351bd39cf24140a79f3bf06a8eee440985a9c601c4749b097c93e37b
parent964663009bd9d285a6adf7e351f54b341e007733fbfc335e827040df95f78723 (diff)
Use (?m) flag instead of replacing \n
-rw-r--r--layouts/_default/single.gmi6
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi
index 32704a0..09456ab 100644
--- a/layouts/_default/single.gmi
+++ b/layouts/_default/single.gmi
@@ -16,11 +16,11 @@
{{- $content = replace $content $ref_val (print $ref_text "[" $ref_num "]") 1 }}
{{- end }}
{{- else }}
- {{- $content = $content | replaceRE `\n\[(.+?)\]\((.+?)\)` (print "\n=> $2 " $emoji "$1") }}
+ {{- $content = $content | replaceRE `(?m)\[(.+?)\]\((.+?)\)` (print "=> $2 " $emoji "$1") }}
{{- end }}
-{{- $content = $content | replaceRE `\n####{0,3}` "\n###" }}
+{{- $content = $content | replaceRE `(?m)^####{1,3}` "###" }}
{{- $content = $content | replaceRE `(?s)\*{3}(.*?)\*{3}|\*{2}(.*?)\*{2}|\*{1}(.*?)\*{1}` "$1$2$3" }}
-{{- $content = $content | replaceRE `\n- ` "\n* " }}
+{{- $content = $content | replaceRE `(?m)^- ` "* " }}
{{- $content = $content | emojify }}
{{- $content | safeHTML }}
{{- if and (.Page.Params.makerefs | default true) $refs }}