Skip to content

Commit

Permalink
fix: regex of paragraph indent again
Browse files Browse the repository at this point in the history
  • Loading branch information
reuixiy committed Jan 10, 2020
1 parent e6105a9 commit 88ea2c6
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 @@ -177,8 +177,8 @@
{{- $Content := .Scratch.Get "Content" -}}
{{- if ne .Type "poetry" -}}
{{- if (and .Site.Params.enableParagraphIndent .Params.indent) | default (and .Site.Params.enableParagraphIndent (eq .Site.Params.paragraphStyle "indent")) -}}
{{- $regexPatternIndent := `(<p)(>)(.+(<br />|<br>))` -}}
{{- $regexReplacementIndent := `$1 style="text-indent:0;padding-left:2em;margin:1em 0"$2$3` -}}
{{- $regexPatternIndent := `((</p>|<blockquote>)\n<p)(>)(.+(<br />|<br>))` -}}
{{- $regexReplacementIndent := `$1 style="text-indent:0;padding-left:2em;margin:1em 0"$3$4` -}}
{{- $Content := $Content | replaceRE $regexPatternIndent $regexReplacementIndent | safeHTML -}}
{{- .Scratch.Set "Content" $Content -}}
{{- end -}}
Expand Down

0 comments on commit 88ea2c6

Please sign in to comment.