Subject: | URLs quoted with apostrophe fail to parse |
Our CSS files have a lot of url('../some/path.png') and
CSS::Parse::Heavy always stops on the line before such a style.
I finally narrowed it down to what appears to be a bug in
Parse::RecDescent, because the literal for an apostrophe, "'" normally
works but doesn't seem to work as the last part of a rule. The attached
patch works around this by using '\'' instead.
I will follow this up with P::RD but as this workaround is semantically
equivalent figured its worth submitting this here.
Cheers and thanks for a great module.
Subject: | CSS-Parse-PRDGrammar.pm.diff |
--- CSS/Parse/PRDGrammar.pm 2011-03-23 09:30:09.000000000 +1030
+++ /apps/webteam/lib/perl/CSS/Parse/PRDGrammar.pm 2011-10-26 13:15:14.000000000 +1030
@@ -115,7 +115,7 @@
| '"' {$return = $item[1]}
| macro_nonascii {$return = $item[1]}
| macro_escape {$return = $item[1]}
- )(s?) "'" {return "'".join('', @{$item[2]})."'"}
+ )(s?) '\'' {return "'".join('', @{$item[2]})."'"}
macro_nl: /\\n|\\r\\n|\\r|\\f/ {$return = $item[1]}
macro_w: /[ \\t\\r\\n\\f]*/ {$return = $item[1]}