Skip to content

Commit c8428db

Browse files
authored
Merge pull request #9 from aleksip/replace-pattern-name-dots-with-dashes
Replace possible dots in pattern names with dashes
2 parents 9b31f31 + 4ae8878 commit c8428db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/PatternLab/PatternData/Rule.php

+3
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ protected function compareProp($name, $propCompare, $exact = false) {
104104
protected function getPatternName($pattern, $clean = true) {
105105
$patternBits = explode("-",$pattern,2);
106106
$patternName = (((int)$patternBits[0] != 0) || ($patternBits[0] == '00')) ? $patternBits[1] : $pattern;
107+
// replace possible dots with dashes. pattern names cannot contain dots
108+
// since they are used as id/class names in the styleguidekit.
109+
$patternName = str_replace('.', '-', $patternName);
107110
return ($clean) ? (str_replace("-"," ",$patternName)) : $patternName;
108111
}
109112

0 commit comments

Comments
 (0)