Skip to content

Commit ea6cedd

Browse files
committed
feature #125 Process sidebar directive's titles as span nodes (wouterj)
This PR was squashed before being merged into the main branch. Discussion ---------- Process sidebar directive's titles as span nodes Fixes #115 I've also added `composer.lock` to the gitignore, not sure why it wasn't in there already. Commits ------- 3d7d07a Process sidebar directive's titles as span nodes
2 parents 5363271 + 3d7d07a commit ea6cedd

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/docs.phar
66
/.env
77
/.phpunit.result.cache
8+
/composer.lock

src/Directive/SidebarDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function processSub(Parser $parser, ?Node $document, string $variable, st
2525
$wrapperDiv = $parser->renderTemplate(
2626
'directives/sidebar.html.twig',
2727
[
28-
'title' => $data,
28+
'title' => $parser->createSpanNode($data)->render(),
2929
]
3030
);
3131

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
<div class="admonition-wrapper"><div class="admonition admonition-sidebar"><p class="sidebar-title"><span>The sidebar's title</span></p><p>some text inside sidebar</p>
22
</div></div>
3+
4+
<div class="admonition-wrapper"><div class="admonition admonition-sidebar"><p class="sidebar-title"><span>More about the <code translate="no" class="notranslate">request()</code> Method</span></p><p>The full signature of the <code translate="no" class="notranslate">request()</code> method is...</p>
5+
</div></div>

tests/fixtures/source/blocks/directives/sidebar.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
.. sidebar:: The sidebar's title
33

44
some text inside sidebar
5+
6+
.. sidebar:: More about the ``request()`` Method
7+
8+
The full signature of the ``request()`` method is...

0 commit comments

Comments
 (0)