mirror of https://github.com/status-im/codimd.git
feat: define vega code block using json overlay mode in editor
to get vega-lite syntax highlighting work Signed-off-by: Max Wu <jackymaxj@gmail.com>
This commit is contained in:
parent
3a5c6fa5ed
commit
3cc563ec59
|
@ -131,6 +131,17 @@ export default class Editor {
|
|||
}
|
||||
this.eventListeners = {}
|
||||
this.config = config
|
||||
|
||||
// define modes from mode mime
|
||||
let ignoreOverlay = {
|
||||
token: function (stream, state) {
|
||||
stream.next()
|
||||
return null
|
||||
}
|
||||
}
|
||||
CodeMirror.defineMode('vega', function (config, modeConfig) {
|
||||
return CodeMirror.overlayMode(CodeMirror.getMode(config, 'application/ld+json'), ignoreOverlay)
|
||||
})
|
||||
}
|
||||
|
||||
on (event, cb) {
|
||||
|
|
Loading…
Reference in New Issue