How is it possible to replace multiple characters in Codemirror (while typing) to another character?
Say I want to replace =>
with a ligature, or an SVG. And also replace *
with an x
multiplication SVG.
specialChars: /\*/,
specialCharPlaceholder: () => {
const node = document.createElement('i');
// node.innerHTML = 'x';
node.className = 'bp3-icon-standard bp3-icon-small-cross';
return node;
},
With the combination of specialChars
and specialCharPlaceholder
I can do this. But as far as I can tell, I can only do it on one character?
How is it possible to give Codemirror a set of regexes that map to replacements?
I’m not sure specialCharPlaceholder
is the correct way to do this or not.