mirror of
https://github.com/status-im/codimd.git
synced 2025-02-20 04:48:09 +00:00
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.eventListeners = {}
|
||||||
this.config = config
|
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) {
|
on (event, cb) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user