Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix updating of indexes containing escaped characters (#156)
There are a number of different mechanisms with [String#sub](https://ruby-doc.org/core-2.4.5/String.html#method-i-sub) that pertain to the matching of backreferences and capture groups when using either the String or Hash type args for the replacement arg. >If replacement is a String that looks like a pattern's capture group but is actually not a pattern capture group e.g. "\'", then it will have to be preceded by two backslashes like so "\\'". When an index contains unescaped characters, those are being incorrectly interpreted as capture groups. Using the block version of #sub avoids this. For example, here's the behaviour we see with an index containing special characters that need escaping. This becomes a problem given that the issue is in the `Updater` itself; we get stuck in a loop where annotation changes are always being detected, so a CI step with `--frozen` will always fail.
- Loading branch information