Closed khinshankhan closed 1 month ago
No clue!
Are you saying things are broken for you?
They were broken when I did
refractor.register(css)
refractor.register(markup)
but working when I did
refractor.register(markup)
refractor.register(css)
Haven't encountered it yet but I (probably) overthought about cases of how language A may allow for embedding of language B but B may also allow for A.
For now I guess the the only thing I can do is just be more vigilant in testing various embedded languages in languages and trying various register orders.
Right, Prism is a bit weird like that. I don’t think refractor
does anything. Closing as this has more to do with Prism. You could try other highlighters, such as lowlight or starry-night!
I think it definitely matters but unsure how I should organize my custom languages. For context I was trying to syntax highlight
using
html
(alias ofmarkup
). Nothing in the style block was being highlighted (in fact I think github doesn't handle this well either?). However, the playground https://prismjs.com/test.html#language=markup handled it just fine... after I changed languages to css and back to markup.Before I open a bug, I wanted to make a minimal reproduction of the issue and found that the tokenization worked just fine (I was using the esm.sh version for ease). Then realized that using the highlighter from
all
worked just dandy. I narrowed it down to these 2 registrations:since this didn't work:
I'm pretty sure
markup
has to be registered beforecss
.So to generalize that, I'm guessing 'dependencies' (interpolated) of a language should be registered afterwards? A bit shaky on this and what consequences this may have.