{% assign _content = include.content %} {% if _content contains '' %} {% assign _content = _content | replace: '
', '
' | replace: '
', '' | replace: '', '' %} {% endif %} {% if _content contains '
' %}
  {% assign _content = _content
    | replace: '
', '' %} {% endif %} {% if _content contains '
  • <' %} {% assign _content = _content | replace: '"task-list-item"><', '"task-list-item" hide-bullet><' %} {% endif %} {% assign IMG_TAG = '' | first %} {% assign _right = _img_snippet | remove: _left %} {% assign _left = _left | remove: ' /' %} {% assign _left = _left | replace: ' w=', ' width=' | replace: ' h=', ' height=' %} {% assign _attrs = _left | split: ' ' %} {% for _attr in _attrs %} {% assign _pair = _attr | split: '=' %} {% if _pair.size < 2 %} {% continue %} {% endif %} {% capture _key %}{{ _pair | first }}{% endcapture %} {% capture _value %}{{ _pair | last | replace: '"', '' }}{% endcapture %} {% case _key %} {% when 'width' %} {% assign _width = _value %} {% when 'height' %} {% assign _height = _value %} {% when 'src' %} {% assign _src = _value %} {% endcase %} {% if _width and _height and _src %} {% break %} {% endif %} {% endfor %} {% if _src %} {% unless _src contains '://' %} {% if site.img_cdn %} {% assign _src_prefix = site.img_cdn %} {% else %} {% assign _src_prefix = site.baseurl %} {% endif %} {% if page.img_path %} {% assign _path = page.img_path %} {% assign last_char = _path | slice: -1 %} {% unless last_char == '/' %} {% assign _path = _path | append: '/' %} {% endunless %} {% assign _src_prefix = _src_prefix | append: _path %} {% endif %} {% assign _final_src = _src_prefix | append: _src %} {% assign _left = _left | replace: _src, _final_src %} {% endunless %} {% assign _left = _left | replace: 'src=', 'data-src=' %} {% endif %} {% if _width and _height %} {%- capture _svg -%} src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{ _width }} {{ _height }}'%3E%3C/svg%3E" {%- endcapture -%} {% assign _left = _svg | append: ' ' | append: _left %} {% endif %} {% assign _left = _left | append: ' data-proofer-ignore' %} {% assign _img_content = _img_content | append: IMG_TAG | append: _left | append: _right %} {% endfor %} {% assign _content = _img_content %} {% endif %} {% if _content contains '
    ' %} {% assign _code_spippets = _content | split: '
    ' %} {% assign _new_content = '' %} {% for _snippet in _code_spippets %} {% if forloop.last %} {% assign _new_content = _new_content | append: _snippet %} {% else %} {% assign _left = _snippet | split: '><' | last%} {% if _left contains 'file="' %} {% assign _label_text = _left | split: 'file="' | last | split: '"' | first %} {% assign _label_icon = 'far fa-file-code' %} {% else %} {% assign _lang = _left | split: 'language-' | last | split: ' ' | first %} {% capture _label_text %}{% include language-alias.html language=_lang %}{% endcapture %} {% assign _label_icon = 'fas fa-code small' %} {% endif %} {% capture _label %} {% endcapture %} {% assign _new_content = _new_content | append: _snippet | append: '
    ' | append: _label | append: '
    ' | append: '
    ' %} {% endif %} {% endfor %} {% assign _content = _new_content %} {% endif %} {% assign heading_levels = '2,3,4,5' | split: ',' %} {% assign _heading_content = _content %} {% for level in heading_levels %} {% capture mark_start %}{% endcapture %} {% assign left = snippet | split: mark_end | first %} {% assign right = snippet | replace: left, '' %} {% assign _new_content = _new_content | append: mark_start | append: left | append: anchor | append: mark_end | append: right %} {% endfor %} {% assign _heading_content = _new_content %} {% endif %} {% endfor %} {% assign _content = _heading_content %} {{ _content }}