Skip to content

Commit

Permalink
added backslash escapes
Browse files Browse the repository at this point in the history
  • Loading branch information
DmmDGM authored and iiPythonx committed Nov 26, 2024
1 parent c15cd66 commit 9442f27
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nightwatch/web/js/nightwatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { main, grab_data } from "./flows/welcome.js";

// Leftmark :3
const leftmark_rules = [
{ regex: /\*\*(.*?)\*\*/g, replace: "<strong>$1</strong>" },
{ regex: /__(.*?)__/g, replace: "<u>$1</u>" },
{ regex: /~~(.*?)~~/g, replace: "<s>$1</s>" },
{ regex: /\*(.*?)\*/g, replace: "<em>$1</em>" },
{ regex: /\!\[(.*?)\]\((.*?)\)/g, replace: `<a href = "$2" target = "_blank"><img alt = "$1" src = "$2"></a>` },
{ regex: /\[(.*?)\]\((.*?)\)/g, replace: `<a href = "$2" target = "_blank" rel = "noreferrer">$1</a>` }
{ regex: /\*\*((?:[^\\]|\\.)*?)\*\*/g, replace: "<strong>$1</strong>" },
{ regex: /__((?:[^\\]|\\.)*?)__/g, replace: "<u>$1</u>" },
{ regex: /~~((?:[^\\]|\\.)*?)~~/g, replace: "<s>$1</s>" },
{ regex: /\*((?:[^\\]|\\.)*?)\*/g, replace: "<em>$1</em>" },
{ regex: /\!\[((?:[^\\]|\\.)*?)\]\(((?:[^\\]|\\.)*?)\)/g, replace: `<a href = "$2" target = "_blank"><img alt = "$1" src = "$2"></a>` },
{ regex: /\[((?:[^\\]|\\.)*?)\]\(((?:[^\\]|\\.)*?)\)/g, replace: `<a href = "$2" target = "_blank" rel = "noreferrer">$1</a>` }
];

function leftmark(content) {
Expand Down

0 comments on commit 9442f27

Please sign in to comment.