feat: auto-load KaTeX's mchecm extension (#605)
Some checks failed
Build Site / Check and Build for Pull Requests (push) Has been cancelled
Build Site / Build and Deploy on Main Push (push) Has been cancelled

This commit is contained in:
Óscar 2026-01-01 23:20:35 +01:00 committed by GitHub
parent d617318ae6
commit 4068430e73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 65 additions and 14 deletions

View file

@ -46,6 +46,10 @@
{%- if macros_settings::evaluate_setting_priority(setting="katex", page=page_s, section=section_s, default_global_value=false) == "true" -%}
<link rel="stylesheet" href="{{ get_url(path='katex.min.css', trailing_slash=false) | safe }}">
<script defer src="{{ get_url(path='js/katex.min.js', trailing_slash=false) | safe }}"></script>
{# Load mhchem extension if chemistry formulas detected #}
{%- if page and page.content and ("\ce{" in page.content or "\pu{" in page.content) -%}
<script defer src="{{ get_url(path='js/mhchem.min.js', trailing_slash=false) | safe }}"></script>
{%- endif -%}
{%- endif -%}
{# Load mermaid.js #}