{%- set content = page.content | trim -%} {#- Remove main heading (first

) -#} {%- set parts = content.split('

', 1) -%} {%- if parts | length > 1 and parts[0].startswith('', '">') -%} {#- Open external links in new tab -#} {%- set content = content | replace('Q-CTRL') -%} {#- Convert code blocks This is necessary because we use fenced code blocks to also define Mermaid diagrams, so we need to turn this:
...
into this:
...
so we're going to start by coverting this:
...
to this:
...
This is a hack and breaks semantics but it's the best zero-config solution we have at this point to support both syntax highlighting and Mermaid diagrams. -#} {%- set content = content | replace('
', '') -%} {%- set content = content | replace('
', '
') -%}

{#- Convert admonitions -#}
{%- set content = content | replace('

Abstract:', '

Abstract:') -%} {%- set content = content | replace('

Bug:', '

Bug:') -%} {%- set content = content | replace('

Danger:', '

Danger:') -%} {%- set content = content | replace('

Example:', '

Example:') -%} {%- set content = content | replace('

Failure:', '

Failure:') -%} {%- set content = content | replace('

Important:', '

Important:') -%} {%- set content = content | replace('

Info:', '

Info:') -%} {%- set content = content | replace('

Note:', '

Note:') -%} {%- set content = content | replace('

Question:', '

Question:') -%} {%- set content = content | replace('

Success:', '

Success:') -%} {%- set content = content | replace('

Tip:', '

Tip:') -%} {%- set content = content | replace('

Warning:', '

Warning:') -%} {{- content -}}