From a99905a505e4f6ff6ee15544a7dbf108749ca650 Mon Sep 17 00:00:00 2001 From: viktorking7 <140458814+viktorking7@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:45:46 +0200 Subject: [PATCH] Update toc.html --- _includes/toc.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_includes/toc.html b/_includes/toc.html index 9c5bbf62257ebb..fa186b7daa9429 100644 --- a/_includes/toc.html +++ b/_includes/toc.html @@ -80,8 +80,9 @@ {% endif %} {% capture heading_body %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %} + {% comment %} Escape brackets in heading text to prevent Markdown link breakage in TOC {% endcomment %} {% capture my_toc %}{{ my_toc }} -{{ space }}{{ listModifier }} {{ listItemClass }} [{{ heading_body | replace: "|", "\|" }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %} +{{ space }}{{ listModifier }} {{ listItemClass }} [{{ heading_body | replace: "|", "\|" | replace: "[", "\[" | replace: "]", "\]" }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %} {% endfor %} {% if include.class and include.class != blank %}