Skip to content

Commit

Permalink
Change RegExp to only support two nested square brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
snap01 committed Mar 22, 2023
1 parent 8753080 commit e904f01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/apps/coc7-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class CoC7Parser {
let text = []

text = TextEditor._getTextNodes(html)
const rgx = new RegExp('@(coc7)\\.' + '([^\\]]+?)' + '\\[((?:[^\\]\\[]+|\\[(?:[^\\]\\[]+|\\[[^\\]\\[]*\\])*\\])*)\\]' + '(?:{([^}]+)})?', 'gi')
const rgx = new RegExp('@(coc7)\\.' + '(check|effect|item|sanloss)' + '\\[([^\\[\\]]*(?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\])*[^\\[\\]]*\\])*[^\\[\\]]*)\\]' + '(?:{([^}]+)})?', 'gi')
TextEditor._replaceTextContent(text, rgx, CoC7Link._createLink)
return html.innerHTML
}
Expand Down

0 comments on commit e904f01

Please sign in to comment.