aboutsummaryrefslogtreecommitdiff
path: root/layouts
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
commit61ba4b8cbb02bde9c62faa2698f7e0a419fe60a98193b2a70de1a2b475bb39c8 (patch)
tree9064744fbb3dc102551a05920872f2e0a19a69b3131e316cc0ed5872a22706eb /layouts
parent4b02ee6ac412cf1111dfb3c34e0ebd8adfd5758115aaea25ccee8658d6d7e590 (diff)
downloadhugo-theme-journal-61ba4b8cbb02bde9c62faa2698f7e0a419fe60a98193b2a70de1a2b475bb39c8.tar.gz
hugo-theme-journal-61ba4b8cbb02bde9c62faa2698f7e0a419fe60a98193b2a70de1a2b475bb39c8.zip
Improve bold/italics regex
Diffstat (limited to 'layouts')
-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 a8be38d..fdadecb 100644
--- a/layouts/_default/single.gmi
+++ b/layouts/_default/single.gmi
@@ -73,9 +73,9 @@
{{ $rendered_text = $rendered_text | replaceRE `(?m)^[\t ]*(\S.+?)[\t ]*\n\-+$` "## $1" -}}
{{/* remove bold and italics asterisk symbols */ -}}
- {{ $rendered_text = $rendered_text | replaceRE `\*{3}(\S|\S.*?\S)\*{3}` "$1" -}}
- {{ $rendered_text = $rendered_text | replaceRE `\*{2}(\S|\S.*?\S)\*{2}` "$1" -}}
- {{ $rendered_text = $rendered_text | replaceRE `\*{1}(\S|\S.*?\S)\*{1}` "$1" -}}
+ {{ $rendered_text = $rendered_text | replaceRE `\*{3}(\S(?:.*\S)?)\*{3}` "$1" -}}
+ {{ $rendered_text = $rendered_text | replaceRE `\*{2}(\S(?:.*\S)?)\*{2}` "$1" -}}
+ {{ $rendered_text = $rendered_text | replaceRE `\*{1}(\S(?:.*\S)?)\*{1}` "$1" -}}
{{/* convert Markdown alternative unordered list syntax to gemtext unordered list syntax */ -}}
{{ $rendered_text = $rendered_text | replaceRE `(?m)^[-+] ` "* " -}}