Closed CheloXL closed 3 years ago
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
index.ts | 1 | 50.0% | ||
src/minifyHTMLLiterals.ts | 55 | 2.42% | ||
<!-- | Total: | 56 | --> |
Totals | |
---|---|
Change from base Build 77: | -74.9% |
Covered Lines: | 4 |
Relevant Lines: | 64 |
Thanks for the PR! It looks like I had originally investigated this but never finished the implementation.
The problem with my original idea (just passing the string to RegExp to make the last semicolon optional) as you found out is that the parens are special characters and are not escaped. While this approach works, I'd like to try and stick with simple string splitting, rather than introduce any new potential complexity with the RegExp class (especially if others are overriding the getPlaceholder method).
I've pushed a fix to the main branch and will release an update shortly. Thanks again for the report!
Fixes #28. The original RegExp split method was not working as it needs to properly escape rx delimiters, etc. Added RX escape method and replaced the old string.split with the new RX split.