Replies: 1 comment 5 replies
-
The problem seems to be that JS templates isn't loaded correctly. Could you provide a minimal example that reproduces the bug? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working with this implementation of Prism in a React component and I'm wondering how I can leverage prism-js-template support in a
jsx
codeblock with my and @RunDevelopment's recent contributions to the improved GraphQL support :)The library does run the
before-
andafter-tokenize
hooks, but, I think they have an explicit limitation on how deep down the token tree they will go... that being said, the tokens logged below are directly copied from the function linked in this paragraph, as far as I can tell.I wanted to write here just in case it's simply solvable with some configuration -- I have passed in my own Prism setup as documented and I am calling
require('prismjs/components/prism-js-templates')
, but:this code sample
is tokenized by the library [even though it seems to call the same set of hooks as Prism itself] to:
which is different from what is produced in the tokenizer tests when you put this in
tests/languages/jsx!+graphql+js-templates
(which behaves as expected of course).The correct tokenization properly parses the graphql template string:
Beta Was this translation helpful? Give feedback.
All reactions