artlantis / phamlp

Automatically exported from code.google.com/p/phamlp
0 stars 0 forks source link

Support "-" in class names (easy one-char fix) #129

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Class names with hyphens should be supported like this:

%span.hello-world

The fix is easy... In this part of the HamlParser class:

// Match classes
if (preg_match_all('/\\'.self::TOKEN_CLASS.'([a-zA-Z0-9_]*)/', $sToParse, 
$aMatches))

Just add hyphen to end of the RegEx character class:

// Match classes
if (preg_match_all('/\\'.self::TOKEN_CLASS.'([a-zA-Z0-9_-]*)/', $sToParse, 
$aMatches))

Original issue reported on code.google.com by zekevic...@gmail.com on 10 Oct 2013 at 10:25