Skip to content

Commit

Permalink
fix: regex of content.html
Browse files Browse the repository at this point in the history
  • Loading branch information
reuixiy committed Jan 16, 2020
1 parent eaefda4 commit 6bb169d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/partials/components/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{{- if $enableDropCap -}}
{{- $regexPatternDropCap := `(<p)(>)(.)([^<]+)` -}}
{{- $regexReplacementDropCap := `$1 style="text-indent:0"$2<span class="drop-cap">$3</span>$4` -}}
{{- $firstParagraphOld := (delimit (findRE $regexPatternDropCap .Content 1) " ") -}}
{{- $firstParagraphOld := (delimit (findRE $regexPatternDropCap $Content 1) " ") -}}
{{- $firstParagraphNew := (replaceRE $regexPatternDropCap $regexReplacementDropCap $firstParagraphOld) -}}
{{- $Content := replace $Content $firstParagraphOld $firstParagraphNew | safeHTML -}}
{{- .Scratch.Set "Content" $Content -}}
Expand Down Expand Up @@ -193,7 +193,7 @@
{{- if not $enableDropCap -}}
{{- $regex := `(<p)(>[^<]+)` -}}
{{- $replacement := `$1 style="text-indent:0"$2` -}}
{{- $firstParagraphOld := (delimit (findRE $regex .Content 1) " ") -}}
{{- $firstParagraphOld := (delimit (findRE $regex $Content 1) " ") -}}
{{- $firstParagraphNew := (replaceRE $regex $replacement $firstParagraphOld) -}}
{{- $Content := replace $Content $firstParagraphOld $firstParagraphNew | safeHTML -}}
{{- .Scratch.Set "Content" $Content -}}
Expand Down

0 comments on commit 6bb169d

Please sign in to comment.