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