From: m5o Date: Wed, 14 Nov 2018 13:10:23 +0000 (+0200) Subject: Fix placeholder image replacement. X-Git-Tag: v4.2.0~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6163533d84b98e04880ebe05aa5c2e37b2d77b18;p=thirdparty%2Fbootstrap.git Fix placeholder image replacement. --- diff --git a/site/_includes/example.html b/site/_includes/example.html index 63621c64b7..308d2850b2 100644 --- a/site/_includes/example.html +++ b/site/_includes/example.html @@ -18,15 +18,32 @@ optional: hide_markup - disabled (default) {%- if include.hide_markup == null -%} {%- highlight html -%} - {%- if include.content contains 'data-src="holder.js' -%} + {%- if include.content contains '', '✂️' | split: '✂️' -%} + {%- if include.content contains 'bd-placeholder-img ' -%} + {%- assign image_class = include.content + | replace_first: 'bd-placeholder-img', 'bd-placeholder-img ✂️' + | replace: '" width="', '✂️" width="' + | split: '✂️' -%} + {%- assign image_class = image_class[1] | replace: 'bd-placeholder-img-lg', '' | strip -%} + {%- endif -%} + + {%- assign image_alt = include.content + | replace: '', '<title>✂️' + | replace: '', '✂️' + | split: '✂️' -%} + {%- assign image_alt = image_alt[1] -%} + {%- for content_chunk in modified_content -%} - {%- if content_chunk contains 'holder.js' -%} - {{- "..." -}} + {%- if content_chunk contains ' + {%- endcapture -%} + {{- img_placeholder -}} {%- else -%} {{- content_chunk -}} {%- endif -%}