diff options
author | Nicholas Johnson <nick@nicholasjohnson.ch> | 2023-01-25 00:00:00 +0000 |
---|---|---|
committer | Nicholas Johnson <nick@nicholasjohnson.ch> | 2023-01-25 00:00:00 +0000 |
commit | 3cd063f392ab3694e540fc018e886f5b6f93d965283b0f51f99d4db77f47aecf (patch) | |
tree | 7de5424e1a7f4b34b80df36510888eeba1a6adee49033192332934954428bc48 /layouts/_default | |
parent | 3fb3e566afd980915e0b95022aa18c87eedb0438a36c8f8e6b9e03d0386dd360 (diff) | |
download | hugo-theme-journal-3cd063f392ab3694e540fc018e886f5b6f93d965283b0f51f99d4db77f47aecf.tar.gz hugo-theme-journal-3cd063f392ab3694e540fc018e886f5b6f93d965283b0f51f99d4db77f47aecf.zip |
Make regex more precise
Diffstat (limited to 'layouts/_default')
-rw-r--r-- | layouts/_default/single.gmi | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index ce0d0ce..04c09de 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -9,12 +9,12 @@ # {{ .Name | safeHTML }} {{ $content := .RawContent }} {{- $scratch := newScratch }} -{{- $chunks := findRE `(?sm)(?:(.*?)(^\x60{3}.*?^\x60{3}$))|(.*$)` $content }} +{{- $chunks := findRE `(?sm)(?:(.*?)(^\x60{3}[^\x60].*?^\x60{3}$))|(.*$)` $content }} {{- range $chunks }} - {{- $before_pre := replaceRE `(?sm)(?:(.*?)(^\x60{3}.*?^\x60{3}$))|(.*$)` "$1" . 1 }} - {{- $pre := replaceRE `(?sm)(?:(.*?)(^\x60{3}.*?^\x60{3}$))|(.*$)` "$2" . 1 }} - {{- $after_pre := replaceRE `(?sm)(?:(.*?)(^\x60{3}.*?^\x60{3}$))|(.*$)` "$3" . 1 }} + {{- $before_pre := replaceRE `(?sm)(?:(.*?)(^\x60{3}[^\x60].*?^\x60{3}$))|(.*$)` "$1" . 1 }} + {{- $pre := replaceRE `(?sm)(?:(.*?)(^\x60{3}[^\x60].*?^\x60{3}$))|(.*$)` "$2" . 1 }} + {{- $after_pre := replaceRE `(?sm)(?:(.*?)(^\x60{3}[^\x60].*?^\x60{3}$))|(.*$)` "$3" . 1 }} {{- $cur_chunk := print $before_pre $after_pre }} |