docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.78k stars 5.68k forks source link

An exception occurs when Katex inline formula contains subscripts #2286

Closed LzcGeorge closed 1 year ago

LzcGeorge commented 1 year ago

My text is 字母:$a$ , $c$ 和 $n_0 $ , $n_0 +$ But $n_0$ shows wrongly, Why is there an extra scroll wheel below this?

How to remove the roller below? Thanks .

Koooooo-7 commented 1 year ago

Hi @LzcGeorge , could you plz provide an reproduce sample on it ?

FYI, I test it locally.

# Test
My text is 字母:$a$  , $c$ 和 $n_0 $ , $n_0 +$
image
LzcGeorge commented 1 year ago

Hi @Koooooo-7,Thank you for your help. I checked my JavaScript file again and found the source of my issue.

At fist,my js file like that

<script src="//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="//cdn.jsdelivr.net/npm/docsify-latex@0"></script>

Most of the cases are showing normal behavior, but there is an issue occurring like this.

Now ,I change it and it works!

<script src="//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="//cdn.jsdelivr.net/npm/marked@4"></script>

<!-- CDN files for docsify-katex -->
<script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>

Thanks!

Koooooo-7 commented 1 year ago

no prob.