@@ -13,7 +13,9 @@ discard block |
||
13 | 13 | } |
14 | 14 | |
15 | 15 | public function replaceContent($element, $content) { |
16 | - if ($element->getAttribute('transphporm') == 'added') return; |
|
16 | + if ($element->getAttribute('transphporm') == 'added') { |
|
17 | + return; |
|
18 | + } |
|
17 | 19 | //If this rule was cached, the elements that were added last time need to be removed prior to running the rule again. |
18 | 20 | if ($element->getAttribute('transphporm')) { |
19 | 21 | $this->replaceCachedContent($element); |
@@ -27,7 +29,9 @@ discard block |
||
27 | 29 | |
28 | 30 | private function insertNodes($element, $content) { |
29 | 31 | foreach ($this->content->getNode($content, $element->ownerDocument) as $node) { |
30 | - if ($node instanceof \DomElement && !$node->getAttribute('transphporm')) $node->setAttribute('transphporm', 'added'); |
|
32 | + if ($node instanceof \DomElement && !$node->getAttribute('transphporm')) { |
|
33 | + $node->setAttribute('transphporm', 'added'); |
|
34 | + } |
|
31 | 35 | $element->parentNode->insertBefore($node, $element); |
32 | 36 | } |
33 | 37 | } |