diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-04-11 02:27:01 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-04-11 02:27:01 +0200 |
commit | d21055d1e4d84ebb0e0a981ac3a240bbeb14560e (patch) | |
tree | 2401a095745981bad889af73e0edb04e4bab9031 /src/edit.js | |
parent | 7503edafe206d9f16da4d12b6dea0458ca9c2432 (diff) | |
download | wcms-d21055d1e4d84ebb0e0a981ac3a240bbeb14560e.tar.gz wcms-d21055d1e4d84ebb0e0a981ac3a240bbeb14560e.zip |
codemirror style and editor cleanup
Diffstat (limited to 'src/edit.js')
-rw-r--r-- | src/edit.js | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/edit.js b/src/edit.js index 7496adf..7be4c06 100644 --- a/src/edit.js +++ b/src/edit.js @@ -16,7 +16,7 @@ CodeMirror.defineSimpleMode('wcms', { // detect a Wcms markup then pass to 'wcms' mode start: [ { - regex: /%(?=(HEADER|NAV|ASIDE|MAIN|FOOTER|SUMMARY|LIST|MEDIA)(\?[^\s]*)?%)/, + regex: /%(?=(HEADER|NAV|ASIDE|MAIN|FOOTER|SUMMARY|LIST|MEDIA|TITLE|DESCRIPTION|DATE|TIME|THUMBNAIL)(\?[^\s]*)?%)/, token: 'wcms', next: 'wcms', }, @@ -35,16 +35,33 @@ CodeMirror.defineSimpleMode('wcms', { { regex: /.*%/, token: 'wcms', next: 'start' }, ], // 'element' mode, parameters' keywords of 'element' macros - element: [{ regex: null, push: 'wcms' }], + element: [ + { + regex: /id|autolink|markdown|headerid/, + token: 'wkeyword', + push: 'wcms', + }, + { regex: null, push: 'wcms' }, + ], // 'summary' mode, parameters' keywords of the 'summary' macro summary: [ - { regex: /min|max/, token: 'keyword', push: 'wcms' }, + { regex: /min|max|element/, token: 'wkeyword', push: 'wcms' }, { regex: null, push: 'wcms' }, ], // 'list' mode, parameters' keywords of the 'list' macro - list: [{ regex: null, push: 'wcms' }], + list: [ + { + regex: /sortby|order|secure|tagcompare|authorcompare|tagfilter|authorfilter|linkto|limit|description|thumbnail|date|time|author|style/, + token: 'wkeyword', + push: 'wcms', + }, + { regex: null, push: 'wcms' }, + ], // 'media' mode, parameters' keywords of the 'media' macro - media: [{ regex: null, push: 'wcms' }], + media: [ + { regex: /path|sortby|order|type/, token: 'wkeyword', push: 'wcms' }, + { regex: null, push: 'wcms' }, + ], }); CodeMirror.defineMode('wcms-markdown', (config, parserConfig) => { |