I have noticed in the past weeks that I fairly often wouldn’t get syntax highlighting for properly tagged code snippets, and needed to reload the browser page. I’m pretty sure this is caused by loading the CSS/JS needed for syntax highlighting conditionally only when tags are present on the page. This fails e.g. when I’m editing a post and the content reloads, but the page doesn’t refresh fully.
This led to syntax highlighting not working. However, removing the file name on one raw tag made also others’ highlighting work. Then again, I’m trying to reproduce it right here and I get highlighting:
#let variable = "test"
Maybe someone else viewing this doesn’t? In any case it’s strange…
It’s probably unrelated to having a file in the raw block or not. I’ve noticed that the Typst forum theme CSS doesn’t load properly until I refresh once or twice. You can see this by looking at the icons in the sidebar: they are off until you refresh, when the CSS gets applied. It also affects syntax highlighting and other visuals. I’m not sure what causes this, but could be worth an investigation.
It seems that sometimes, it tries to load non-existing files. Whenever the syntax highlighting and the custom CSS isn’t working, I see this error in the console:
That link leads to a 404 page. When reloading the page, the file names change and the files actually exist, so maybe there is a caching issue somewhere.
I’m also seeing CORS issues when accessing the font files, but the fonts are still applied correctly, so that’s not much of a problem.