Skip to content

Conversation

@xihale
Copy link
Member

@xihale xihale commented Jan 20, 2026

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @xihale, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on maintaining the project's external dependencies by upgrading the KaTeX and Mermaid libraries to their latest stable versions. This ensures that the rendering of mathematical equations and diagrams benefits from the most recent features, bug fixes, and security improvements provided by these libraries, enhancing the overall stability and functionality of the application.

Highlights

  • KaTeX Version Update: The KaTeX library has been updated from version 0.15.2 to 0.16.9, affecting both the CSS and JavaScript files, along with their respective Subresource Integrity (SRI) hashes.
  • Mermaid Version Update: The Mermaid diagramming library has been updated from version 8.14.0 to 11.12.0, including the update of its JavaScript file and its corresponding SRI hash.
  • Integrity Hashes Refreshed: All updated library files (KaTeX CSS, KaTeX JS, and Mermaid JS) have had their Subresource Integrity (SRI) hashes refreshed to ensure content authenticity and security.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@xihale
Copy link
Member Author

xihale commented Jan 20, 2026

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the versions of the KaTeX and Mermaid.js libraries. The KaTeX update appears correct. However, the major version update for Mermaid.js from v8 to v11 introduces a breaking API change. The current implementation uses mermaid.initialize(), which was removed in v10, and will cause Mermaid diagrams to fail to render. I have added a comment with a suggested fix to use the new mermaid.run() API.

</ctx>
<ctx :if="$page.custom.getOr('mermaid', false)">
<script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/mermaid/8.14.0/mermaid.min.js" integrity="sha512-vLumCjg7NKEQKGM+xAgBYTvQ90DVu6Eo7vS1T/iPf2feNLcrpGxvumuUUmE3CPiCUPgviyKbtpWGDbhnVnmJxg==" crossorigin="anonymous" onload="mermaid.initialize({startOnLoad:true});"></script>
<script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/mermaid/11.12.0/mermaid.min.js" integrity="sha512-5TKaYvhenABhlGIKSxAWLFJBZCSQw7HTV7aL1dJcBokM/+3PNtfgJFlv8E6Us/B1VMlQ4u8sPzjudL9TEQ06ww==" crossorigin="anonymous" onload="mermaid.initialize({startOnLoad:true});"></script>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The major version bump of Mermaid.js from v8 to v11 includes breaking changes. The mermaid.initialize() function was removed in v10 and should be replaced with mermaid.run() to render the diagrams. The startOnLoad option is also no longer needed with the new API.

    <script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/mermaid/11.12.0/mermaid.min.js" integrity="sha512-5TKaYvhenABhlGIKSxAWLFJBZCSQw7HTV7aL1dJcBokM/+3PNtfgJFlv8E6Us/B1VMlQ4u8sPzjudL9TEQ06ww==" crossorigin="anonymous" onload="mermaid.run();"></script>

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the versions of KaTeX and Mermaid libraries. The changes are applied correctly to both the layout file and the corresponding documentation. I've added a couple of suggestions to improve maintainability by centralizing the version information and reducing code duplication, which should make future updates easier.

Comment on lines 3 to 15
<ctx :if="$page.custom.getOr('math', false)">
<link href="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/KaTeX/0.15.2/katex.min.css" integrity="sha512-g1pxMKWnqCJA5bTMwnw0Xwe0KQAfnj47+1pB0oISMqVFjm8Bg1vA3RENj+iGunE9j4zDLPWbau7jirWwJyshdQ==" crossorigin="anonymous" rel="stylesheet">
<link href="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/KaTeX/0.16.9/katex.min.css" integrity="sha512-fHwaWebuwA7NSF5Qg/af4UeDx9XqUpYpOGgubo3yWu+b2IQR4UeQwbb42Ti7gVAjNtVoI/I9TEoYeu9omwcC6g==" crossorigin="anonymous" rel="stylesheet">
<script
defer
src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/KaTeX/0.15.2/katex.min.js"
integrity="sha512-iegr9Cbvw50rG0agCU/1HUJ0w5GflT+Lsk2SRI1jOjEC15RRgJW9vMLDFxIF3mBxoIDIS41fnENNuSZD+WhIOA=="
src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/KaTeX/0.16.9/katex.min.js"
integrity="sha512-LQNxIMR5rXv7o+b1l8+N1EZMfhG7iFZ9HhnbJkTp4zjNr5Wvst75AqUeFDxeRUa7l5vEDyUiAip//r+EFLLCyA=="
crossorigin="anonymous"
></script>
<script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/KaTeX/0.15.2/contrib/auto-render.min.js" integrity="sha512-ZA/RPrAo88DlwRnnoNVqKINnQNcWERzRK03PDaA4GIJiVZvGFIWQbdWCsUebMZfkWohnfngsDjXzU6PokO4jGw==" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
<script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/KaTeX/0.16.9/contrib/auto-render.min.js" integrity="sha512-iWiuBS5nt6r60fCz26Nd0Zqe0nbk1ZTIQbl3Kv7kYsX+yKMUFHzjaH2+AnM6vp2Xs+gNmaBAVWJjSmuPw76Efg==" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
</ctx>
<ctx :if="$page.custom.getOr('mermaid', false)">
<script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/mermaid/8.14.0/mermaid.min.js" integrity="sha512-vLumCjg7NKEQKGM+xAgBYTvQ90DVu6Eo7vS1T/iPf2feNLcrpGxvumuUUmE3CPiCUPgviyKbtpWGDbhnVnmJxg==" crossorigin="anonymous" onload="mermaid.initialize({startOnLoad:true});"></script>
<script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/mermaid/11.12.0/mermaid.min.js" integrity="sha512-5TKaYvhenABhlGIKSxAWLFJBZCSQw7HTV7aL1dJcBokM/+3PNtfgJFlv8E6Us/B1VMlQ4u8sPzjudL9TEQ06ww==" crossorigin="anonymous" onload="mermaid.initialize({startOnLoad:true});"></script>
</ctx>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid repeating version numbers and integrity hashes, you could define them as variables in a parent <ctx> block. This centralizes the configuration, making future updates easier and less error-prone. Based on the project's blog post, it seems Scripty supports string interpolation with {$...}, which would make this refactoring possible.

  <ctx
    katex_version="0.16.9"
    katex_css_integrity="sha512-fHwaWebuwA7NSF5Qg/af4UeDx9XqUpYpOGgubo3yWu+b2IQR4UeQwbb42Ti7gVAjNtVoI/I9TEoYeu9omwcC6g=="
    katex_js_integrity="sha512-LQNxIMR5rXv7o+b1l8+N1EZMfhG7iFZ9HhnbJkTp4zjNr5Wvst75AqUeFDxeRUa7l5vEDyUiAip//r+EFLLCyA=="
    katex_autorender_integrity="sha512-iWiuBS5nt6r60fCz26Nd0Zqe0nbk1ZTIQbl3Kv7kYsX+yKMUFHzjaH2+AnM6vp2Xs+gNmaBAVWJjSmuPw76Efg=="
    mermaid_version="11.12.0"
    mermaid_js_integrity="sha512-5TKaYvhenABhlGIKSxAWLFJBZCSQw7HTV7aL1dJcBokM/+3PNtfgJFlv8E6Us/B1VMlQ4u8sPzjudL9TEQ06ww=="
  >
    <ctx :if="$page.custom.getOr('math', false)">
      <link href="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/KaTeX/{$ctx.katex_version}/katex.min.css" integrity="{$ctx.katex_css_integrity}" crossorigin="anonymous" rel="stylesheet">
      <script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/KaTeX/{$ctx.katex_version}/katex.min.js" integrity="{$ctx.katex_js_integrity}" crossorigin="anonymous"></script>
      <script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/KaTeX/{$ctx.katex_version}/contrib/auto-render.min.js" integrity="{$ctx.katex_autorender_integrity}" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
    </ctx>
    <ctx :if="$page.custom.getOr('mermaid', false)">
      <script defer src="https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/mermaid/{$ctx.mermaid_version}/mermaid.min.js" integrity="{$ctx.mermaid_js_integrity}" crossorigin="anonymous" onload="mermaid.initialize({startOnLoad:true});"></script>
    </ctx>
  </ctx>

@xihale xihale merged commit 6a51bfd into main Jan 20, 2026
3 checks passed
xihale added a commit to xihale/zigcc.github.io that referenced this pull request Jan 22, 2026
* fix(layout): Add cross-origin prototype for Mermaid renderer import

* chore: upgrade mermaid and KaTeX dependencies to latest stable versions

* fix: use mermaid.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants