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
commit28b1d565836f56893413172ecb9228bd1cc4a531c702d47275e98bdb0433e125 (patch)
treeeacf5a82b601470e64893fe459a266dd8f02234bba658722f11090f031aeb1bb
parent417033877032ad9ef2dcf160411d3a9dec7ae4c123461de21f0cb8f1718bbc85 (diff)
downloadhugo-theme-journal-28b1d565836f56893413172ecb9228bd1cc4a531c702d47275e98bdb0433e125.tar.gz
hugo-theme-journal-28b1d565836f56893413172ecb9228bd1cc4a531c702d47275e98bdb0433e125.zip
Don't match newlines in link regex
-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 5671a23..d9da38d 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 -}}