codemirror / codemirror5

In-browser code editor (version 5, legacy)
http://codemirror.net/5/
MIT License
26.82k stars 4.97k forks source link

mode: sql fails #5740

Closed awunnenb closed 5 years ago

awunnenb commented 5 years ago

mode: sql fails, no highlighting all other modes works fine.

codeMirrorOptions = { mode: 'sql', lineNumbers: true, theme: 'material' };

marijnh commented 5 years ago

You're expected to pick a dialect (via a mime type string). But I agree it's not very useful for the mode to not recognize any keywords when you don't—attached patch fixes that.

awunnenb commented 5 years ago

thank you very much. Where can i set the mime-type? In markup or by Code/Config? I can't find any code-example to set mime-type-string for special sql syntax highlighting.

marijnh commented 5 years ago

Instead of "sql", you set the mode option to something like "text/x-pgsql".

Fdango commented 5 years ago

@marijnh I want to set the syntax highlighting of pyhton3, just write it as text/x-python?