html & xml autio select highlighter #485

This commit is contained in:
Jan Prochazka 2023-02-08 07:34:28 +01:00
parent 87c29faadd
commit a3db8e2903

View File

@ -40,6 +40,14 @@
onMount(() => {
editor.getEditor().focus();
if (safeJsonParse(textValue)) syntaxMode = 'json';
if (textValue.match(/<\/[a-zA-z0-9-]+\s*>/)) {
// end tag
if (textValue.match(/<\/(div|span|h[0-6]|p|input|a)\s*>/)) {
syntaxMode = 'html';
} else {
syntaxMode = 'xml';
}
}
});
function handleKeyDown(ev) {