vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Adds support for Github-style fenced math blocks in markdown editor and preview

Open aaronchucarroll opened this issue 1 year ago • 4 comments

VSCode markdown editor now syntactically highlights fenced math blocks. Katex rendering now supports fenced math blocks. They must be of the form

//math goes here

resolves #174731

aaronchucarroll avatar May 29 '24 00:05 aaronchucarroll

@microsoft-github-policy-service agree

aaronchucarroll avatar May 29 '24 00:05 aaronchucarroll

With the latest commits the code changes are only located in markdown-math.

aaronchucarroll avatar Jun 04 '24 12:06 aaronchucarroll

I added a custom parser for fenced math blocks based on the original markdown-it fence parser.

aaronchucarroll avatar Jun 24 '24 00:06 aaronchucarroll

This approach was much simpler. I made these changes in @vscode/markdown-it-katex, and added tests. In markdown-math I set enableFencedBlocks to be true by default but there may be a better way to do this.

The PR to the katex library is here

aaronchucarroll avatar Jun 29 '24 23:06 aaronchucarroll

I reverted all of the unnecessary changes from prior implementations. The main repo still needs the new syntax for syntax highlighting and enabling the fence option.

aaronchucarroll avatar Jul 07 '24 16:07 aaronchucarroll

Please see new changes (ignore accidental git mess)

aaronchucarroll avatar Jul 10 '24 00:07 aaronchucarroll