selectivizr icon indicating copy to clipboard operation
selectivizr copied to clipboard

Whitespace normalization and regex simplification

Open chris-canipe opened this issue 10 years ago • 1 comments

The RE_COMMENT regex seems unnecessarily complex: I've simplified it.

The whitespace normalization is the focus of this pull request. I'm working with Rails' asset pipeline and I found a peculiarity where one of its resulting CSS assets contains over 5,000 spaces (between two sheets that it pulled together). This is causing selectivizr to hang; I suspect the excessive space may be triggering "catastrophic backtracking." I've wrapped the loaded stylesheet with normalizeWhitespace to prevent this from happening.

chris-canipe avatar Aug 14 '13 17:08 chris-canipe

@keithclark disappeared so I'm going to try and maintain this project at https://github.com/corysimmons/selectivizr2

Would you please reopen/rebase your PR over there?

corysimmons avatar Feb 06 '16 07:02 corysimmons