allow longer language name in markdown, longest is 14 according to the lib

require('highlight.js').listLanguages().map(x => x.length).sort((a, b) => b-a)
> [ 14,...
jschan
Thomas Lynch 3 years ago
parent 71ba0900fe
commit 06f5a26ce9
  1. 2
      helpers/posting/markdown.js

@ -11,7 +11,7 @@ const greentextRegex = /^>((?!>\d+|>>/\w+(/\d*)?|>>#
, spoilerRegex = /\|\|([\s\S]+?)\|\|/gm
, detectedRegex = /(\(\(\(.+?\)\)\))/gm
, linkRegex = /\[(?<label>[^\[][^\]]*?)\]\((?<url>https?\:&#x2F;&#x2F;[^\s<>\[\]{}|\\^)]+)\)|(?<urlOnly>https?\:&#x2F;&#x2F;[^\s<>\[\]{}|\\^]+)/g
, codeRegex = /(?:(?<language>[a-z+]{1,10})\r?\n)?(?<code>[\s\S]+)/i
, codeRegex = /(?:(?<language>[a-z+]{1,14})\r?\n)?(?<code>[\s\S]+)/i
, includeSplitRegex = /(\[code\][\s\S]+?\[\/code\])/gm
, splitRegex = /\[code\]([\s\S]+?)\[\/code\]/gm
, trimNewlineRegex = /^\s*(\r?\n)*|(\r?\n)*$/g

Loading…
Cancel
Save