Highlight Key Value pair without value

This commit is contained in:
Peter Stuifzand 2021-08-08 14:54:30 +02:00
parent 707f84ec43
commit da1feee2a2

View File

@ -357,10 +357,13 @@ function Editor(holder, input) {
} else if (converted.startsWith("=", 0)) {
converted = transformMathExpression(converted, scope);
} else {
let re = /^([A-Z0-9 ]+)::\s*(.+)$/i;
let re = /^([A-Z0-9 ]+)::\s*(.*)$/i;
let res = text.match(re)
if (res) {
converted = '<span class="metadata-key">[[' + res[1] + ']]</span>: ' + res[2]
converted = '<span class="metadata-key">[[' + res[1] + ']]</span>'
if (res[2]) {
converted += ': ' + res[2]
}
} else if (text.match(/#\[\[TODO]]/)) {
converted = converted.replace('#[[TODO]]', '<input class="checkbox" type="checkbox" />')
todo = true;