Skip to content

Commit 9dc6c95

Browse files
jaapiolinawolf
authored andcommitted
[FIX] reorder rendering of nodes
In the new version the link node is a compound node as markdown does more complex rendering of links. Reordering the logic makes sure link rendering gets priority over compound nodes.
1 parent b0bbff8 commit 9dc6c95

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

packages/typo3-docs-theme/src/Renderer/NodeRenderer/MainMenuJsonDocumentRenderer.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,6 @@ public function renderSubEntry(Node $node, RenderContext $renderContext, array &
8888
*/
8989
private function renderMenuEntry(array &$menuEntry, Node $node, RenderContext $renderContext): void
9090
{
91-
if ($node instanceof CompoundNode) {
92-
foreach ($node->getChildren() as $childNode) {
93-
$this->renderMenuEntry($menuEntry, $childNode, $renderContext);
94-
}
95-
return;
96-
}
9791
if ($node instanceof LinkInlineNode) {
9892
$this->delegatingReferenceResolver->resolve($node, $renderContext, new Messages());
9993
$url = $node->getUrl();
@@ -103,6 +97,14 @@ private function renderMenuEntry(array &$menuEntry, Node $node, RenderContext $r
10397
}
10498
$menuEntry['name'] = $node->getValue();
10599
$menuEntry['href'] = $url;
100+
return;
101+
}
102+
103+
if ($node instanceof CompoundNode) {
104+
foreach ($node->getChildren() as $childNode) {
105+
$this->renderMenuEntry($menuEntry, $childNode, $renderContext);
106+
}
107+
return;
106108
}
107109
}
108110
/**

0 commit comments

Comments
 (0)