feature (editor): improve syntax highlight for org mode

This commit is contained in:
Mickael KERJEAN 2017-06-15 19:43:54 +10:00
parent 6ac1f1f139
commit 636f8a9c6c

View file

@ -13,6 +13,12 @@ import 'codemirror/addon/dialog/dialog.js';
CodeMirror.defineSimpleMode("orgmode", {
start: [
{regex: /(^\+[^\/]*\+)/, token: ["strikethrough"]},
{regex: /(^\*[^\/]*\*)/, token: ["header", "strong"]},
{regex: /(^\/[^\/]*\/)/, token: ["em"]},
{regex: /(^\_[^\/]*\_)/, token: ["link"]},
{regex: /(^\~[^\/]*\~)/, token: ["comment"]},
{regex: /(^\=[^\/]*\=)/, token: ["comment"]},
{regex: /(^[\*]+)(\s[TODO|NEXT|DONE|DEFERRED|REJECTED|WAITING]{2,})?(.*)/, token: ['comment', 'qualifier', 'header']}, // headline
{regex: /\s*\:?[A-Z_]+\:.*/, token: "qualifier"}, // property drawers
{regex: /(\#\+[A-Z_]*)(\:.*)/, token: ["keyword", 'qualifier']}, // environments