diff --git a/helpers/posting/markdown.js b/helpers/posting/markdown.js index 8bc1f694..e9406a18 100644 --- a/helpers/posting/markdown.js +++ b/helpers/posting/markdown.js @@ -10,7 +10,7 @@ const greentextRegex = /^>((?!>\d+|>>/\w+(/\d*)?|>># , italicRegex = /\*\*(.+?)\*\*/gm , spoilerRegex = /\|\|([\s\S]+?)\|\|/gm , detectedRegex = /(\(\(\(.+?\)\)\))/gm - , linkRegex = /(https?\://[^\s<>\[\]{}|\\^]+/g + , linkRegex = /(https?\://[^\s<>\[\]{}|\\^]+)/g , aLinkRegex = /\[([^\[][^\]]*?)\]\((https?\://[^\s<>\[\]{}|\\^)]+)\)|(https?\://[^\s<>\[\]{}|\\^]+)/g , codeRegex = /(?:(?[a-z+]{1,10})\r?\n)?(?[\s\S]+)/i , includeSplitRegex = /(\[code\][\s\S]+?\[\/code\])/gm diff --git a/models/forms/makepost.js b/models/forms/makepost.js index f4024822..c3750777 100644 --- a/models/forms/makepost.js +++ b/models/forms/makepost.js @@ -412,7 +412,7 @@ ${res.locals.numFiles > 0 ? req.files.file.map(f => f.name+'|'+(f.phash || '')). res.locals.board.settings, res.locals.board.owner, res.locals.user ? res.locals.user.username : null); //get message, quotes and crossquote array const nomarkup = prepareMarkdown(req.body.message, true); - const { message, quotes, crossquotes } = await messageHandler(nomarkup, req.params.board, req.body.thread, permLevel < 4); + const { message, quotes, crossquotes } = await messageHandler(nomarkup, req.params.board, req.body.thread, res.locals.permLevel < 4); //build post data for db. for some reason all the property names are lower case :^) const data = {