vscode-markdown: KaTex Math render problem

What is the problem?

This is a small problem. This code:

$\text{\`{a}}$ <code>\\`{a}</code>

on katex.org should be rendered like this:

image

However, I got this:

image

How can I reproduce it?

Write in your md file:

|||||
|:---------------------|:---------------------|:---------------------|:-----
|$\text{\'{a}}$ `\'{a}`|$\text{\~{a}}$ `\~{a}`|$\text{\.{a}}$ `\.{a}`|$\text{\H{a}}$ `\H{a}`
|$\text{\`{a}}$ <code>\\`{a}</code>|$\text{\={a}}$ `\={a}`|$\text{\"{a}}$ `\"{a}`|$\text{\v{a}}$ `\v{a}`
|$\text{\^{a}}$ `\^{a}`|$\text{\u{a}}$ `\u{a}`|$\text{\r{a}}$ `\r{a}`|

Is there any error message in the console?

No.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (13 by maintainers)

Most upvoted comments

As for me, I suggested a contribution of ~Hour of coding. Not because it is an hour work but in order to show I do appreciate your time and would like to show it.

I see. Thank you.

My friend, I didn’t come with demands. No need for a wake up call. I know reality just as you.

I suggested a feature, I gave a way to do both (MathJaX support and supporting space after $). It is up to you what to do with it.

My logic is addressing Students and other people using LaTeX. If you feel this ignite motivation on your side, perfect. If not, I thank you for what you did so far.

As for me, I suggested a contribution of ~Hour of coding. Not because it is an hour work but in order to show I do appreciate your time and would like to show it.

Again, thank you for this nice extension. On my side, given a full LaTeX support it would have been the perfect student replacement for LaTex.

The html option is already true. (See the source code (for vscode preview), source code (for exported HTML))


<code>`</code>

looks no problem because you are lucky that there is no following ` character to form an inlne code span. If you try

<code>`</code> and `hello`

Observe the above Markdown syntax highlight and the markdown-it demo

image image

both ` and \ need to escape

<code>\`</code> and `hello`

So theoretically, it should be <code>\\\`</code> rather than <code>\\`</code>

It is all about escaping the special characters \ and `.

For inline code span, Markdown parser does seem to escape them. So you need to use \\ to denote \. And for code block, it seems that we can use \ without escaping.