From da1feee2a23ca7e2687ed80b16adfd8d3c8213f9 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 8 Aug 2021 14:54:30 +0200 Subject: [PATCH] Highlight Key Value pair without value --- editor/src/editor.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/src/editor.js b/editor/src/editor.js index c79081b..cb6eb9e 100644 --- a/editor/src/editor.js +++ b/editor/src/editor.js @@ -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 = '[[' + res[1] + ']]: ' + res[2] + converted = '[[' + res[1] + ']]' + if (res[2]) { + converted += ': ' + res[2] + } } else if (text.match(/#\[\[TODO]]/)) { converted = converted.replace('#[[TODO]]', '') todo = true;