-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Code block highlighting of script tag in html syntax is invalid #9517
Comments
Hi, could you try #9506 (comment)? |
Wow... it works. THANKS SO MUCH! |
Going to reopen until it gets fixed on prism-react-renderer's end. I'm going to send a issue if no one else has |
cc @carloskelly13 any idea what's happening here? Looks like languages are now loaded in the wrong order? (cf #9506 (comment)) |
@slorber Yeah, good find. The problem is the Here is an example of the fix doing what I think we want → ![]() Update: I have a PR here → FormidableLabs/prism-react-renderer#230 |
Thanks @carloskelly13! |
@slorber |
Thanks @carloskelly13 👍 I'll test it soon |
thanks @carloskelly13 , can confirm it works for our own website, and also fix |
@carloskelly13 some impacts our visual regression testing tool detected. (by the way I should have been more careful because when upgrading it reported the regressions 😅 ) It also improves inline style: It fixes this But for some reason this one lose its highlighting when upgradng to v2.2 ![]() Both cases on page https://docusaurus.io/docs/seo Not a big deal though, because it was already the case before under v1. I just thought you might like to know about this edge case. |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
When I upgrade from v2 to v3. I found the html code block not recognize the js code in
<script>
any more, which is normal before upgrading.The following is snapshot.

And I also found that class names of js code is recognized as plain text like this.

Reproducible demo
https://codesandbox.io/p/sandbox/charming-torvalds-h9spkl?file=%2Fsrc%2Fpages%2Fmarkdown-page.md&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clops0uop000d3b6k3a41myzq%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clops0uoo00043b6kjjat6mdy%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clops0uop000b3b6k19zjjaix%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clops0uop000c3b6ke2qbkxpg%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B60%252C40%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clops0uoo00043b6kjjat6mdy%2522%253A%257B%2522id%2522%253A%2522clops0uoo00043b6kjjat6mdy%2522%252C%2522activeTabId%2522%253A%2522clops3pq900qm3b6kzgep5qvz%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252Fsrc%252Fpages%252Fmarkdown-page.md%2522%252C%2522id%2522%253A%2522clops3pq900qm3b6kzgep5qvz%2522%252C%2522mode%2522%253A%2522temporary%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%257D%252C%2522clops0uop000c3b6ke2qbkxpg%2522%253A%257B%2522tabs%2522%253A%255B%255D%252C%2522id%2522%253A%2522clops0uop000c3b6ke2qbkxpg%2522%257D%252C%2522clops0uop000b3b6k19zjjaix%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clops0uop00053b6koulfpl6j%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522docusaurus%2522%257D%252C%257B%2522id%2522%253A%2522clops0uop00063b6kpy8f9oq1%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522start%2522%257D%252C%257B%2522id%2522%253A%2522clops0uop00073b6kxqpgr96l%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522build%2522%257D%252C%257B%2522id%2522%253A%2522clops0uop00083b6ki1hh0et7%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522clear%2522%257D%252C%257B%2522id%2522%253A%2522clops0uop00093b6ka6tt9orb%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522write-heading-ids%2522%257D%252C%257B%2522id%2522%253A%2522clops0uop000a3b6kd6gt7mvo%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%255D%252C%2522id%2522%253A%2522clops0uop000b3b6k19zjjaix%2522%252C%2522activeTabId%2522%253A%2522clops0uop00053b6koulfpl6j%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A23.888888888888886%257D
Steps to reproduce
src/pages/markdown-page.md
.Expected behavior
Highlight valid in html code block.
Actual behavior
and you can find the invalid effect
Your environment
Self-service
The text was updated successfully, but these errors were encountered: