Skip to content

Commit

Permalink
Fix regex complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurankv committed Nov 27, 2023
1 parent 2e80fe6 commit b59ea02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Parsing/InlineCodeParsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface InlineCodeParameters {
}

export function parseInlineCode(codeText: string): {parameters: InlineCodeParameters | null, text: string} {
const match = /^{( *?(?:\w+(?: *?(?:icon|title:(?:\w+|"[^"\n]+"|'[^'\n]+')))*)? *?)} *?([^ ].*?)$/.exec(codeText);
const match = /^{( *(?:\w+(?: +(?:(?:[^\s"']+|"[^"]*"|'[^']*')+))*)? *)} *?([^ ].*?)$/.exec(codeText);

if (typeof match?.[1] !== "undefined" && typeof match?.[2] !== "undefined") {
if (match[1] === "")
Expand Down

0 comments on commit b59ea02

Please sign in to comment.