{% if highlight.context %}
{# Render markdown to HTML first, then wrap highlight substring in a span. #}
{% set htmlContext = highlight.context|markdown_to_html %}
{% if highlight.content in highlight.context %}
{% set wrapper = '' ~ highlight.content ~ '' %}
{# Replace occurrences in rendered HTML and output raw HTML #}
{% set rendered = htmlContext|replace({ (highlight.content): wrapper }) %}
{{ rendered|raw }}
{% else %}