mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-20 12:01:29 +02:00
Adjustments to rendering spacing
This commit is contained in:
parent
a971e5aa54
commit
00835c5101
@ -193,15 +193,29 @@ final class Element implements Renderable
|
|||||||
if ($this->Contents !== null) {
|
if ($this->Contents !== null) {
|
||||||
$html .= '>';
|
$html .= '>';
|
||||||
|
|
||||||
if (! empty($this->Contents)) {
|
$First = \reset($this->Contents);
|
||||||
$html .= "\n";
|
|
||||||
|
|
||||||
|
if (
|
||||||
|
$First instanceof Element
|
||||||
|
&& ! \array_key_exists(\strtolower($First->name()), self::TEXT_LEVEL_ELEMENTS)
|
||||||
|
) {
|
||||||
|
$html .= "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($this->Contents)) {
|
||||||
foreach ($this->Contents as $C) {
|
foreach ($this->Contents as $C) {
|
||||||
$html .= $C->getHtml();
|
$html .= $C->getHtml();
|
||||||
|
|
||||||
|
if (
|
||||||
|
$C instanceof Element
|
||||||
|
&& ! \array_key_exists(\strtolower($C->name()), self::TEXT_LEVEL_ELEMENTS)
|
||||||
|
) {
|
||||||
|
$html .= "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= "</" . $elementName . ">\n";
|
$html .= "</" . $elementName . ">";
|
||||||
} else {
|
} else {
|
||||||
$html .= ' />';
|
$html .= ' />';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user