Closed alexarchambault closed 5 years ago
This whole section of the code needs significant testing if we're going to keep it stable and merge many more PRs, but I'm going to merge this for now based on inspection.
Note please that another patch which handled $ slightly differently went in as #5 - it may be that we have a specification round and the behaviour becomes documented and canonical between you and @zawn
This PR proposes to escape the class name components prior to passing them to regexes.
For standard / usual class names, this shouldn't change the current behavior.
For class names having non standard characters (
$
in particular), this allows to shade these with jarjar. Without this PR, these are currently simply not escaped (as the$
signs get interpreted as end-of-line from the regexes).I'm kind of new to this codebase, any direction would be welcome about where and how to add non regression tests for these (unless I'm mistaken, I couldn't find a comprehensive test suite in the current code).