29 foreach ($node->attributes() as $attribute) {
33 $name = $attribute->getName();
34 $value = (string) $attribute;
38 $this->textCase = $value;
52 switch ($this->textCase) {
54 $text = $this->keepNoCase(mb_strtoupper($text), $text);
57 $text = $this->keepNoCase(mb_strtolower($text), $text);
61 $text = mb_strtolower($text);
67 case 'capitalize-all':
75 case 'capitalize-first':
91 private function keepNoCase($render, $original)
93 if (preg_match(
'/<span class=\"nocase\">(\p{L}+)<\/span>/i', $original, $match)) {
94 return preg_replace(
'/(<span class=\"nocase\">\p{L}+<\/span>)/i', $match[1], $render);