From b872ebadbb64c755f60f867acaa373e9109c0256713891c92dfbdb362dd5dbcf Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Thu, 2 May 2024 00:00:00 +0000 Subject: Give rationale for bold/italics code --- layouts/_default/single.gmi | 1 + 1 file changed, 1 insertion(+) (limited to 'layouts/_default') diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index fdadecb..b871d67 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -73,6 +73,7 @@ {{ $rendered_text = $rendered_text | replaceRE `(?m)^[\t ]*(\S.+?)[\t ]*\n\-+$` "## $1" -}} {{/* remove bold and italics asterisk symbols */ -}} + {{/* 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" -}} -- cgit v1.2.3