-
It looks like Twind shim is resetting the syntax highlighting stuff injected by https://prismjs.com/ and I see these warnings in the console: You can see this in action here: https://ema.srid.ca/start/tutorial Note that code blocks are syntax highlighted on page load, and then it is undone after a fraction of a second (when twind resets them). Is there a way avoid this? I should clarify that this is a statically generated site, so no JS is otherwise involved. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
I tried your page without JS (no shim) and I do not see the syntax highlight. The classes are not removed from the elements. Are you sure you are sending the CSS for the highlight? |
Beta Was this translation helpful? Give feedback.
-
Hey I don't know too much about prismjs but I just inspected the source of the site you posted and it seems like the content of the code block is just a string on the Tutorial page whereas on other pages the string is parsed and compiled into the appropriate markup for syntax highlighting. Tutorial page: Other Page: Syntax highlighting seems to work on both the initial and subsequent loads of all other pages other than the Tutorial. Assuming you are using Twind on all pages, my conclusion is that this issue is with that specific page and/or SSR rather than with Twind. Did you ever find what was up? |
Beta Was this translation helpful? Give feedback.
-
As indicated here this appears to be a bug in PrismJS. |
Beta Was this translation helpful? Give feedback.
As indicated here this appears to be a bug in PrismJS.