Skip to content

Commit

Permalink
fix: regex of paragraph indent
Browse files Browse the repository at this point in the history
  • Loading branch information
reuixiy committed Jan 9, 2020
1 parent 7f6ed75 commit c7ce9bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layouts/partials/components/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
{{- $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>\n<p)(>)(.+(<br />|<br>))` -}}
{{- $regexPatternIndent := `(<p)(>)(.+(<br />|<br>))` -}}
{{- $regexReplacementIndent := `$1 style="text-indent:0;padding-left:2em;margin:1em 0"$2$3` -}}
{{- $Content := $Content | replaceRE $regexPatternIndent $regexReplacementIndent | safeHTML -}}
{{- .Scratch.Set "Content" $Content -}}
Expand Down

0 comments on commit c7ce9bb

Please sign in to comment.