I'm using Monaco editor in my app. I get this error on Firefox and some versions of Chrome and somehow it works fine with version 96 of Chrome
Console displays:
Invalid regular expression: /^*-+:*$/: Nothing to repeat

This is the code:
$(function () {
require.config({ paths: { vs: '/static/node_modules/monaco-editor/min/vs' } });
let editor;
require(['vs/editor/editor.main'], () => {
editor = monaco.editor.create(document.getElementById("content"), {
theme: 'vs-dark',
language: "yaml",
model: monaco.editor.createModel(`{{content | safe }}`),
wordWrap: 'on',
automaticLayout: true,
minimap: {
enabled: false
},
scrollbar: {
useShadows: false,
verticalHasArrows: true,
horizontalHasArrows: true,
vertical: 'auto',
horizontal: 'auto',
verticalScrollbarSize: 17,
horizontalScrollbarSize: 17,
arrowSize: 30
}
});
});
You need to escape the first * or the starting ^. You cannot repeat the starting ^. Choose to use one literal or the other. So 'zero or more ^' or starting with *.
/\^*/
or
/^\*/