Open toddself opened 7 years ago
Here is a gist of our grammar file (converted to JSON with season)
And this is how we're loading it:
const codemirror = require('codemirror')
const atomGrammer = require('codemirror-atom-modes')
const fountain = require('./fountain-grammar.json')
atomGrammer.registerGrammars([fountain], codemirror)
codemirror('#editor', {mode: 'Fountain'})
HI!
We're trying to use the atom fountain grammar, but all the text seems to be receiving the same CSS class attribute regardless. (
cm-source-fountain
andcm-meta
).atom screenshot:
CodeMirror screenshot:
Would love to help figure out what is going on here -- tried changing the
name
attributes in the grammar file to see if it just a matter of matching the names correctly against the list of tokens in codemirror, but that doesn't seem to change.If I remove the section that defines
meta
in the grammar it does make a difference -- nothing gets thecm-meta
class, but they still don't receive the proper classes based on their tokens.I know fountain requires some lookahead functionality, so perhaps this is due to the regex engine for the browser?