codemirror-atom-modes icon indicating copy to clipboard operation
codemirror-atom-modes copied to clipboard

fountain grammar doesn't seem to work

Open toddself opened this issue 8 years ago • 1 comments

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 and cm-meta).

atom screenshot: image

CodeMirror screenshot: image

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 the cm-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?

toddself avatar Jun 28 '17 17:06 toddself

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'})

toddself avatar Jun 28 '17 17:06 toddself