goessner/mdmath

When I save MD document to HTML document, the `code block language highlighting` function doesn't work properly.

hustnzj opened this issue · 1 comments

Summary

When I save MD document to HTML document, the code block language highlighting function doesn't work properly.
...

Expected behavior

image

...

Actual behavior

image

...

Steps to reproduce

  1. type the .md

  2. in vscode, command + shift + P, and type the command as below:
    image

  3. Open the output html in the browsers (chrome, firefox, safari etc)

Code example

$a$  
$\varphi$  
$1+1=2$  
$1+1<3$
```js
document.write('Hello, world')

The reason I guess

Open the console panel of the browsers, I found the error tip:

Refused to apply style from 'https://cdn.jsdelivr.net/npm/highlight.js@9.18.1/lib/index.min.js' because its MIME type ('application/javascript') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

And I found the link src tag is used for the https://cdn.jsdelivr.net/npm/highlight.js@9.18.1/lib/index.min.js. Why is it not script tag?
image

I tried to use the script tag instead of the link one, but still got this error as below:
image
image

I tried to modify the extension.js in the extension root menu, but still didn't work.
image

Environment

     Operating system: macOS Big Sur
       VSCode version: 1.55.2
Markdown+Math version: 2.5.1

Link to highlight.js has become invalid.

Works again with mdmath version 2.6.