From b073e35b942de7cdf78abde8f7bbd1439f37d8220412ad9a3907f9da0e6c93a7 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Sun, 22 Jan 2023 00:00:00 +0000 Subject: Use (?m) flag instead of replacing \n --- layouts/_default/single.gmi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'layouts/_default') 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 }} -- cgit v1.2.3