diff --git a/nightwatch/web/js/nightwatch.js b/nightwatch/web/js/nightwatch.js index aa59aeb..f1ecb75 100644 --- a/nightwatch/web/js/nightwatch.js +++ b/nightwatch/web/js/nightwatch.js @@ -5,12 +5,12 @@ import { main, grab_data } from "./flows/welcome.js"; // Leftmark :3 const leftmark_rules = [ - { regex: /\*\*(.*?)\*\*/g, replace: "$1" }, - { regex: /__(.*?)__/g, replace: "$1" }, - { regex: /~~(.*?)~~/g, replace: "$1" }, - { regex: /\*(.*?)\*/g, replace: "$1" }, - { regex: /\!\[(.*?)\]\((.*?)\)/g, replace: `$1` }, - { regex: /\[(.*?)\]\((.*?)\)/g, replace: `$1` } + { regex: /\*\*((?:[^\\]|\\.)*?)\*\*/g, replace: "$1" }, + { regex: /__((?:[^\\]|\\.)*?)__/g, replace: "$1" }, + { regex: /~~((?:[^\\]|\\.)*?)~~/g, replace: "$1" }, + { regex: /\*((?:[^\\]|\\.)*?)\*/g, replace: "$1" }, + { regex: /\!\[((?:[^\\]|\\.)*?)\]\(((?:[^\\]|\\.)*?)\)/g, replace: `$1` }, + { regex: /\[((?:[^\\]|\\.)*?)\]\(((?:[^\\]|\\.)*?)\)/g, replace: `$1` } ]; function leftmark(content) {