Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe some problems caused by the update #34

Closed
WhyLIM opened this issue Sep 13, 2022 · 1 comment
Closed

Maybe some problems caused by the update #34

WhyLIM opened this issue Sep 13, 2022 · 1 comment
Labels
question Further information is requested

Comments

@WhyLIM
Copy link

WhyLIM commented Sep 13, 2022

Describe the bug

Previously I was using the following CDN:

<!-- CDN files for docsify-katex -->
<script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"/>

But just recently, I found that the formula rendering was invalid. After replacing the current CDN file, I found that the support for the mhchem package was lost.

current CDN:

<script src="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css" />
<script src="https://cdn.jsdelivr.net/npm/marked@3"></script>
<!-- CDN files for docsify-katex -->
<script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>

To Reproduce
Steps to reproduce the behavior:

  1. A website for demos of mhchem: https://docs.moodle.org/400/en/Chemistry_notation_using_mhchem
  2. You can use demos in the website above to test
  3. A complex demo of my own :
$$\ce{葡萄糖-6-磷酸 ->[\color{#F65353}{葡萄糖-6-磷酸脱氢酶}、\color{#58B1FF}{Mg^{2+}}][\color{#7EC636}{NADP+\ \nearrow \quad \searrow\ NADPH + H+}] 葡萄糖-6-膦酸内酯}$$

Expected behavior
My demo should be like:
image

Screenshots
The current version renders as:
image

Desktop (please complete the following information):

  • OS: Windows 11 Pro 21H2
  • Browser version: Chrome 105.0.1343.33
  • docsify version: latest
  • docsify-katex version: latest

Additional context
Add any other context about the problem here.

@upupming
Copy link
Owner

upupming commented Sep 13, 2022

After the update, you should include the mhchem extension manually using an extra script, see: https://github.com/KaTeX/KaTeX/blob/main/contrib/mhchem/README.md

<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/mhchem.min.js" integrity="sha384-RTN08a0AXIioPBcVosEqPUfKK+rPp+h1x/izR7xMkdMyuwkcZCWdxO+RSwIFtJXN"  crossorigin="anonymous"></script>

@upupming upupming added the question Further information is requested label Sep 13, 2022
@upupming upupming pinned this issue Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants