Skip to content

Commit 2a9bbf7

Browse files
authored
Merge pull request #769 from wouterj/figures
Two minor figure bugs
2 parents b7d2835 + 63b2424 commit 2a9bbf7

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

packages/guides-restructured-text/src/RestructuredText/Directives/FigureDirective.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ protected function processSub(
6060
'target' => $scalarOptions['target'] ?? null,
6161
'class' => $scalarOptions['class'] ?? null,
6262
'name' => $scalarOptions['name'] ?? null,
63+
'align' => $scalarOptions['align'] ?? null,
6364
]);
6465

6566
return new FigureNode($image, new CollectionNode($collectionNode->getChildren()));

packages/guides/resources/template/html/body/figure.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% if node.document %}
88
{% set caption = renderNode(node.document) %}
99

10-
{% if caption %}
10+
{% if caption|trim %}
1111
<figcaption>{{ caption|raw }}</figcaption>
1212
{% endif %}
1313
{% endif %}

tests/Functional/tests/figure/figure.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
<p>This is a foo!</p>
55
</figcaption>
66
</figure>
7+
<figure>
8+
<img src="img/test-image.jpg" />
9+
</figure>

tests/Functional/tests/figure/figure.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
:width: 100
33

44
This is a foo!
5+
6+
.. figure:: img/test-image.jpg

0 commit comments

Comments
 (0)