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 | da0f617e36e91b66ac098df80c0fca577a6ab58b9e555d25a1f0ca5e1dd12ac2 (patch) | |
tree | cfa88242fdcdce142238630a1d4403e4c045bdf46a87a9f5c7be0a7848e11c72 /layouts | |
parent | 7060e338acd85057be0038b15f0fca711d5845d0660fc01741a4c6756c0b8bae (diff) | |
download | hugo-theme-journal-0.3.1.tar.gz hugo-theme-journal-0.3.1.zip |
Rename $cur_chunk to $rendered_textv0.3.1
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/single.gmi | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index 9e454a8..c32b812 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -16,30 +16,30 @@ {{- $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 }} + {{- $rendered_text := print $before_pre $after_pre }} - {{- $scratch.Set "refs" (findRE `\[.+?\]\(.+?\)` $cur_chunk) }} + {{- $scratch.Set "refs" (findRE `\[.+?\]\(.+?\)` $rendered_text) }} {{- $refs := $scratch.Get "refs" }} {{- if ($.Page.Params.makerefs | default true) }} {{- range $ref_index, $ref_val := $refs }} {{- $ref_num := add $ref_index 1 }} {{- $ref_text := replaceRE `\[(.+?)\]\((.+?)\)` "$1" $ref_val 1 }} - {{- $cur_chunk = replace $cur_chunk $ref_val (print $ref_text "[" $ref_num "]") 1 }} + {{- $rendered_text = replace $rendered_text $ref_val (print $ref_text "[" $ref_num "]") 1 }} {{- end }} {{- else }} - {{- $cur_chunk = $cur_chunk | replaceRE `(?m)^\[(.+?)\]\((.+?)\)$` (print "=> $2 " $emoji "$1") }} + {{- $rendered_text = $rendered_text | replaceRE `(?m)^\[(.+?)\]\((.+?)\)$` (print "=> $2 " $emoji "$1") }} {{- end }} - {{- $cur_chunk = $cur_chunk | replaceRE `(?m)^####{1,3}` "###" }} - {{- $cur_chunk = $cur_chunk | replaceRE `\*{3}(\S.+?\S)\*{3}|\*{2}(\S.+?\S)\*{2}|\*{1}(\S.+?\S)\*{1}` "$1$2$3" }} - {{- $cur_chunk = $cur_chunk | replaceRE `(?m)^- ` "* " }} - {{- $cur_chunk = $cur_chunk | emojify }} + {{- $rendered_text = $rendered_text | replaceRE `(?m)^####{1,3}` "###" }} + {{- $rendered_text = $rendered_text | replaceRE `\*{3}(\S.+?\S)\*{3}|\*{2}(\S.+?\S)\*{2}|\*{1}(\S.+?\S)\*{1}` "$1$2$3" }} + {{- $rendered_text = $rendered_text | replaceRE `(?m)^- ` "* " }} + {{- $rendered_text = $rendered_text | emojify }} {{- if $before_pre }} - {{- $cur_chunk | safeHTML }} + {{- $rendered_text | safeHTML }} {{- $pre | safeHTML }} {{- else }} {{- $pre | safeHTML }} - {{- $cur_chunk | safeHTML }} + {{- $rendered_text | safeHTML }} {{- end }} {{- end }} |