Open JordanMagnuson opened 8 years ago
The highlighter expects the <<
>>
syntax to contain a twee expression inside the arrow braces, and has special highlighting for that, e.g.:
Unfortunately that makes it tricky to also have <<script>>
tags acts as a 'marker' for a javascript block. I don't think I realised this was even a valid syntax?
Glad you're getting some use out of this little project, and thanks for the contributions 👍
Thanks for the reply! Ah yes, I believe this is a feature of the Sugarcube 2 story format. See here. Basically it's a macro/tag that allows you to insert pure javascript inline within any passage, not just those tagged with 'script,' which is a very handy feature when you want to run a quick bit of code from any given passage. I use this feature frequently for things like this:
<<script>>
if (!sndShouting.playing()) {
sndShouting.play();
}
<</script>>
My passages thus end up peppered with javascript, but all of the js just shows up white with the current syntax highlighting, which makes it hard to tell what's going on.
Would be awesome if you could add support for this, since Sugarcube is one of the most-utilized and best-supported story formats going right now. Thanks for the consideration!
Javascript is currently highlighted within [script] tagged passages (which is awesome), but not within normal passage
<<script>>
blocks. See screenshot: http://i.imgur.com/8Q4v4M8.png