codenothing/CSSTree — pull request #2 by cgiffard (2013-06-25 06:14:29+00:00)
Title: Fixes issue with duplicated escape characters in nested blocks.

In Behaviour Assertion Sheets, I allow the use of regex in the sheet, which caused me to find an issue where escape characters in nested blocks have their escape sequences duplicated. Here's a test case:

@all {
/* Testing for a known problem with escape sequences */
selector {
test: /a\/(b)/;
}
}

In this case, `/a\/(b)/` becomes `/a\/\(b)/`, which breaks the regular expression. I imagine that other values in CSS could possibly be affected, although I haven't found a good example yet.

Fixing the issue was a simple matter of skipping to the next loop iteration with `continue` after the escape sequence had been determined.

I've verified that the test suite still passes locally.

If you could push this to npm (if you accept and merge it) that'd be awesome!