diff options
author | Makise Von <v.makise@foxmail.com> | 2021-11-17 17:00:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 17:00:02 +0300 |
commit | 27ba8bbd6489226679c94548fb1429b71771fba8 (patch) | |
tree | e91776095b82e00b63bc283a6137ee36b6e9ec4f | |
parent | 72212b2dd61224aeacf84d0f327ed5291e7bbc9b (diff) |
fix: drop cap to the identical paras only once (#356)
```
// text
xxx
xxx
// before
Xxx
Xxx
// after
Xxx
xxx
```
-rw-r--r-- | layouts/partials/utils/content.html | 2 |
1 files changed, 1 insertions, 1 deletions
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<span class="drop-cap">$3</span>$4` -}} {{- $firstParagraphOld := (delimit (findRE $regexPatternDropCap $Content 1) " ") -}} {{- $firstParagraphNew := (replaceRE $regexPatternDropCap $regexReplacementDropCap $firstParagraphOld) -}} - {{- $Content = replace $Content $firstParagraphOld $firstParagraphNew -}} + {{- $Content = replace $Content $firstParagraphOld $firstParagraphNew 1 -}} {{- end -}} <!-- Drop Cap After `<hr />` --> |