aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicholasjohnson.ch>2024-04-30 00:00:00 +0000
committerNicholas Johnson <nick@nicholasjohnson.ch>2024-04-30 00:00:00 +0000
commit9ebfc99f09478129f3d6e0486403ce36eb5556b3b8e7d70efd01ca92370d3cbc (patch)
tree118540a0548f9d5471f6ade84e05da5544aebefff7edc17ef9a8fdf7ce4fc491
parente13d11d7900e63f504fc3aed93f9eac9192d55a691f1610fe6d3268673d8d57a (diff)
Don't match newlines inside Markdown links
-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 4bba03c..3072add 100644
--- a/layouts/_default/single.gmi
+++ b/layouts/_default/single.gmi
@@ -34,7 +34,7 @@
{{ if ($.Page.Params.makerefs | default true) -}}
{{/* find all the links within a chunk */ -}}
- {{ $chunk_refs := findRESubmatch `!?\[\s*(.+?)\s*\]\(\s*(.+?)(?:\s+"(.+?)")?\s*\)` $rendered_text -}}
+ {{ $chunk_refs := findRESubmatch `!?\[[\t ]*(.+?)[\t ]*\]\([\t ]*(.+?)(?:[\t ]+"(.+?)")?[\t ]*\)` $rendered_text -}}
{{ $scratch.Add "refs" $chunk_refs -}}
{{ range $chunk_refs -}}
@@ -61,7 +61,7 @@
{{ else -}}
{{/* render all links directly */ -}}
- {{ $rendered_text = $rendered_text | replaceRE `(?m)^!?\[\s*(.+?)\s*\]\(\s*(.+?)(?:\s+"(.+?)")?\s*\)$` (print "=> $2 " $emoji "$1") -}}
+ {{ $rendered_text = $rendered_text | replaceRE `(?m)^!?\[[\t ]*(.+?)[\t ]*\]\([\t ]*(.+?)(?:[\t ]+"(.+?)")?[\t ]*\)$` (print "=> $2 " $emoji "$1") -}}
{{ end -}}