Skip to content

Commit

Permalink
fix links regex (fixes #1911, via #2280)
Browse files Browse the repository at this point in the history
  • Loading branch information
baev authored Jan 10, 2024
1 parent bf7d126 commit 70b63a5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SafeString } from "handlebars/runtime";

const URL_REGEXP = /((?:(https?:\/\/|ftp:\/\/)|(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}|www\.?))\S+?)(\s|"|'|\)|]|$)/gm;
const URL_REGEXP = /((?:(https?:\/\/|ftp:\/\/|mailto:)|www\.)\S+?)(\s|"|'|\)|]|}|&#62|$)/gm;

const encodeHTMLEntities = (rawString) =>
rawString.replace(/[\u00A0-\u9999<>&]/gim, (i) => `&#${i.charCodeAt(0)};`);
Expand Down

0 comments on commit 70b63a5

Please sign in to comment.