From df7b74f1a316e232868ff7fbbafe12e4977c70e8 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 20 Oct 2023 19:00:35 +0300 Subject: [PATCH] tweaking... Signed-off-by: Alex A. Naanou --- experiments/outline-editor/editor.js | 32 +++++++++++++++++++++++++++ experiments/outline-editor/index.html | 3 ++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 1f1380a..e53da7a 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -538,16 +538,48 @@ var styling = { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// // XXX use ligatures for these??? var symbols = { __proto__: plugin, + // XXX use a single regex with handler func to do these... + symbols: { + '>>': '»', + '<<': '«', + '->': '→', + '<-': '←', + '=>': '⇒', + '<=': '⇐', + '(i)': '🛈', + '(c)': '©', + '/!\\': '⚠', + }, + get symbols_pattern(){ + return new RegExp(`(?>/gm, '»') + .replace(/(?/gm, '→') + .replace(/(?/gm, '⇒') + .replace(/(?)/gm, '←') + .replace(/(?)/gm, '⇐') .replace(/(?, <=, =>, <<, >> _(not sure about these)_ + - -- and --- - - --- - ### Playground for testing