diff options
author | Nicholas Johnson <nick@nicholasjohnson.ch> | 2024-04-30 00:00:00 +0000 |
---|---|---|
committer | Nicholas Johnson <nick@nicholasjohnson.ch> | 2024-04-30 00:00:00 +0000 |
commit | d9f7bfd82607bde563e6443b5fc46fa744a3431da6bcc66dd04571009600e879 (patch) | |
tree | a8441925f640e1604367c29fe4141361588d85f38fd31c36893ce910ee8425ee | |
parent | 32368534e0aec3253eff5ef9a5094b38656268aa7048c03ccbe5a1524d13c6cb (diff) |
Add explanatory comments
-rw-r--r-- | layouts/_default/single.gmi | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index 755766e..ff9c81f 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -80,6 +80,8 @@ {{ $rendered_text = $rendered_text | replaceRE `(?m)^[1-9]\d*\.[\t ]+(.*?)[\t ]*$` "* $1" -}} {{/* remove bold and italics asterisk symbols */ -}} + {{/* note: this operation is performed last to prevent false positives in the above conversions */ -}} + {{/* note: this operation is performed in 3 steps to handle nested bold and italics */ -}} {{ $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" -}} |