textEscapes["\xc2\xa0"] = ' '; } public function element( SerializerNode $parent, SerializerNode $node, $contents ) { $name = $node->name; $s = "<$name"; foreach ( $node->attrs->getValues() as $attrName => $attrValue ) { $encValue = strtr( $attrValue, $this->attributeEscapes ); $s .= " $attrName=\"$encValue\""; } if ( $node->namespace === HTMLData::NS_HTML ) { if ( isset( $this->prefixLfElements[$name] ) ) { $s .= ">\n$contents"; } elseif ( !isset( $this->voidElements[$name] ) ) { $s .= ">$contents"; } else { $s .= " />"; } } else { $s .= ">$contents"; } return $s; } }