diff options
author | Nicholas Johnson <nick@nicholasjohnson.ch> | 2023-02-05 00:00:00 +0000 |
---|---|---|
committer | Nicholas Johnson <nick@nicholasjohnson.ch> | 2023-02-05 00:00:00 +0000 |
commit | e2b45e248570e47dbdb85a2538dc416ce75f34f0d2e00de6f782f2a4790cf05b (patch) | |
tree | dd911def1be042daddbc7bd535ae3cd7216db585d1117f42d97c6d607167ab3e | |
parent | b9e449e82104ead0e3b7a95c0e3e49363a4f4ea0eadada5016a9679ad9932351 (diff) | |
download | hugo-theme-journal-e2b45e248570e47dbdb85a2538dc416ce75f34f0d2e00de6f782f2a4790cf05b.tar.gz hugo-theme-journal-e2b45e248570e47dbdb85a2538dc416ce75f34f0d2e00de6f782f2a4790cf05b.zip |
Fix Gemini bold/italics removal regexv0.3.3
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | layouts/_default/single.gmi | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -2,4 +2,3 @@ - add tag support - document "layouts/_default/single.gmi" - test internationalization -- rewrite regex in "layouts/_default/single.gmi" to remove nested italics/bolding diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index e93ee81..e7e4d0c 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -30,7 +30,9 @@ {{- $rendered_text = $rendered_text | replaceRE `(?m)^\[(.+?)\]\((.+?)\)$` (print "=> $2 " $emoji "$1") }} {{- end }} {{- $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 `\*{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 `(?m)^- ` "* " }} {{- $rendered_text = $rendered_text | emojify }} |