Updated code system to dynamically set php codemirror mode

- Codemirror mode mapping value can now be a function to dynamically set
mode depending on actual code content.
- Used above system to set php mode type, depending on if '<?php' tags
exist in content.

Closes #1557
This commit is contained in:
Dan Brown
2019-12-07 16:23:44 +00:00
parent 7af6fe4917
commit a6bbe46987
3 changed files with 40 additions and 24 deletions

View File

@ -9,7 +9,7 @@ const methods = {
this.$refs.overlay.components.overlay.hide();
},
updateEditorMode(language) {
codeLib.setMode(this.editor, language);
codeLib.setMode(this.editor, language, this.editor.getValue());
},
updateLanguage(lang) {
this.language = lang;