]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Tighten regex a bit.
authorXhmikosR <xhmikosr@gmail.com>
Thu, 24 Oct 2019 13:47:38 +0000 (16:47 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Mon, 4 Nov 2019 13:32:29 +0000 (15:32 +0200)
If we need to make this more robust in the future, we can revert this as needed.

site/layouts/shortcodes/example.html

index b1385653a2d2231c5c057725e6936f537b58418b..6701b1377b2b1e27521da25cc2c1e85f8b4a8906 100644 (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 -}}