Tighten regex a bit.

If we need to make this more robust in the future, we can revert this as needed.
This commit is contained in:
XhmikosR 2019-10-24 16:47:38 +03:00
parent e40b3355f0
commit 972369c997
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@
{{- end -}}
{{- if eq $show_markup true -}}
{{- $content := replaceRE `<svg.*class=.bd\-placeholder\-img(?:\-lg)?(?:\s*?bd\-placeholder\-img\-lg)?\s?(.*?)".*?<\/svg>\n` `<img src="..." class="$1" alt="...">` $input -}}
{{- $content = replaceRE `(class="\s*?")` "" $content -}}
{{- $content := replaceRE `<svg class="bd\-placeholder\-img(?:\-lg)?(?: *?bd\-placeholder\-img\-lg)? ?(.*?)".*?<\/svg>\n` `<img src="..." class="$1" alt="...">` $input -}}
{{- $content = replaceRE `(class=" *?")` "" $content -}}
{{- highlight (trim $content "\n") "html" "" -}}
{{- end -}}