From 9442f27048743799d64596361ec88b5f87e4b11a Mon Sep 17 00:00:00 2001 From: dm123321_31md Date: Tue, 26 Nov 2024 01:18:56 -0500 Subject: [PATCH] added backslash escapes --- nightwatch/web/js/nightwatch.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) {