{% assign demo-code = code %} {% assign demo-code = demo-code | replace_regex: '\{% (end)?hide %\}', '' %} {% assign demo-code = demo-code | replace_regex: 'href="#"', 'href="javascript:void(0)"' %}