pinojs / quick-format-unescaped

Solves a problem with util.format
MIT License
17 stars 13 forks source link

fix: support placeholders next to each other #22

Closed watson closed 5 years ago

watson commented 5 years ago

If a placehodler match is found, instead of incrementing both lastPos and i by two, we have to increment only lastPos by two, and i by one, because i is also incremented by one again by the end of the loop.

Before this fix, i would have been incremented by three which caused the second placeholder to be skipped.

Fixes #18

davidmarkclements commented 5 years ago

thanks @watson !