summaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/single.gmi4
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi
index 38a2a8c..ff4af95 100644
--- a/layouts/_default/single.gmi
+++ b/layouts/_default/single.gmi
@@ -20,7 +20,7 @@
{{- $rendered_text := print $before_pre $after_pre }}
{{- if ($.Page.Params.makerefs | default true) }}
- {{- $chunk_refs := findRESubmatch `!?\[(.+?)\]\((.+?)(?:\s+"(.+?)")?\)` $rendered_text }}
+ {{- $chunk_refs := findRESubmatch `!?\[\s*(.+?)\s*\]\(\s*(.+?)(?:\s+"(.+?)")?\s*\)` $rendered_text }}
{{- $scratch.Add "refs" $chunk_refs }}
{{- range $chunk_refs }}
{{- $ref_index = add $ref_index 1 }}
@@ -28,7 +28,7 @@
{{- $rendered_text = replace $rendered_text (index . 0) (print $ref_text "[" $ref_index "]") 1 }}
{{- end }}
{{- else }}
- {{- $rendered_text = $rendered_text | replaceRE `(?m)^!?\[(.+?)\]\((.+?)(?:\s+"(.+?)")?\)$` (print "=> $2 " $emoji "$1") }}
+ {{- $rendered_text = $rendered_text | replaceRE `(?m)^!?\[\s*(.+?)\s*\]\(\s*(.+?)(?:\s+"(.+?)")?\s*\)$` (print "=> $2 " $emoji "$1") }}
{{- end }}
{{- $rendered_text = $rendered_text | replaceRE `(?m)^####{1,3}` "###" }}
{{- $rendered_text = $rendered_text | replaceRE `\*{3}(\S|\S.*?\S)\*{3}` "$1" }}