Lavaeolous / PF1-StatBlock-Converter-Module

FoundryVTT Module to convert PF1 Statblocks into Foundry Actors (PC or NPC).
MIT License
14 stars 12 forks source link

Asterisks aren't escaped for RegExp #505

Closed mkahvi closed 2 years ago

mkahvi commented 2 years ago

Anamurumon for examples has

Gear +1 leather lamellar**, Ikarikurusai (+3 shock sansetsukon**; see page 60), 

Which then explodes with following error:

sbcUtils.js:951 Uncaught (in promise) SyntaxError: Invalid regular expression: /Ikarikurusai \(\+3 shock sansetsukon**, see page 60\)/: Nothing to repeat
[Detected 1 package: pf1-statblock-converter]
    at new RegExp (<anonymous>)
    at Function.sbcSplit (sbcUtils.js:951)
    at gearParser.parse (sbcParsers.js:3880)
    at parseStatistics (sbcParsers.js:3332)
    at async parseCategories (sbcParsers.js:165)
    at async Function.parseInput (sbcParser.js:212)
    at async Function.prepareInput (sbcParser.js:66)
    at async sbcInput.js:111

Obviously since the ** is bad regexp and isn't escaped at all, causing the RE to fail.

Lavaeolous commented 2 years ago

Fixed in 3.3.5