From 27ba8bbd6489226679c94548fb1429b71771fba8 Mon Sep 17 00:00:00 2001 From: Makise Von Date: Wed, 17 Nov 2021 22:00:02 +0800 Subject: fix: drop cap to the identical paras only once (#356) ``` // text xxx xxx // before Xxx Xxx // after Xxx xxx ``` --- layouts/partials/utils/content.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/utils/content.html b/layouts/partials/utils/content.html index 0819137..a1bf70b 100644 --- a/layouts/partials/utils/content.html +++ b/layouts/partials/utils/content.html @@ -52,7 +52,7 @@ {{- $regexReplacementDropCap := `$1 style="text-indent:0"$2$3$4` -}} {{- $firstParagraphOld := (delimit (findRE $regexPatternDropCap $Content 1) " ") -}} {{- $firstParagraphNew := (replaceRE $regexPatternDropCap $regexReplacementDropCap $firstParagraphOld) -}} - {{- $Content = replace $Content $firstParagraphOld $firstParagraphNew -}} + {{- $Content = replace $Content $firstParagraphOld $firstParagraphNew 1 -}} {{- end -}} -- cgit v1.2.3