diff --git a/build/kint.phar b/build/kint.phar index ad12ad5fc..d6c1843a9 100644 Binary files a/build/kint.phar and b/build/kint.phar differ diff --git a/src/Parser/SimpleXMLElementPlugin.php b/src/Parser/SimpleXMLElementPlugin.php index a4ad6d623..db6f9b9c1 100644 --- a/src/Parser/SimpleXMLElementPlugin.php +++ b/src/Parser/SimpleXMLElementPlugin.php @@ -125,7 +125,9 @@ public function parse(&$var, Value &$o, int $trigger): void } } - $x->addRepresentation($a, 0); + if ($a->contents) { + $x->addRepresentation($a, 0); + } // Children $c = new Representation('Children'); @@ -195,14 +197,14 @@ public function parse(&$var, Value &$o, int $trigger): void $s = $this->parser->parse($value, $base_obj); $srep = $s->getRepresentation('contents'); - $svalrep = $s->value && 'contents' == $s->value->getName() ? $s : null; + $svalrep = $s->value && 'contents' == $s->value->getName() ? $s->value : null; if ($srep || $svalrep) { $x->setIsStringValue(true); $x->value = $srep ?: $svalrep; if ($srep) { - $x->replaceRepresentation($x->value, 0); + $x->replaceRepresentation($srep, 0); } } diff --git a/src/Renderer/Rich/SimpleXMLElementPlugin.php b/src/Renderer/Rich/SimpleXMLElementPlugin.php new file mode 100644 index 000000000..87d987079 --- /dev/null +++ b/src/Renderer/Rich/SimpleXMLElementPlugin.php @@ -0,0 +1,56 @@ +isStringValue() || !empty($o->getRepresentation('attributes')->contents)) { + return null; + } + + $b = new BlobValue(); + $b->transplant($o); + $b->type = 'string'; + + $children = $this->renderer->renderChildren($b); + $header = $this->renderer->renderHeader($o); + $header = $this->renderer->renderHeaderWrapper($o, (bool) \strlen($children), $header); + + return '