Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/guides/src/Nodes/Inline/VariableInlineNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class VariableInlineNode extends InlineNode
{
final public const TYPE = 'variable';

private Node $child;
private Node|null $child = null;

public function __construct(string $value)
{
Expand All @@ -19,6 +19,10 @@ public function __construct(string $value)

public function getChild(): Node
{
if ($this->child === null) {
return new PlainTextInlineNode('|' . $this->value . '|');
}

return $this->child;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Some table with long lines</title>

</head>
<body>
<div class="section" id="some-table-with-long-lines">
<h1>Some table with long lines</h1>

<table>
<thead>
<tr>
<th>Project</th>
<th>Links</th>
</tr>
</thead>

<tbody>
<tr>
<td>TSconfig Reference (full)</td>
<td>|unkown| and another reStructuredText variable</td>
</tr>
</tbody>
</table>

</div>

</body>
</html>
10 changes: 10 additions & 0 deletions tests/Integration/tests/simple-table-with-variable/input/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Some table with long lines
==========================

========================= ==================================================
Project Links
========================= ==================================================
TSconfig Reference (full) |unkown| and another |known| variable
========================= ==================================================

.. |known| replace:: reStructuredText
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Variables in simple tables do not get replaced