Skip to content

Commit af78f35

Browse files
authored
Merge pull request #903 from phpDocumentor/backport/1.x/pr-902
[1.x] [BUGFIX] Support :abbr: textrole
2 parents 17a1cef + c1542b7 commit af78f35

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

packages/guides-restructured-text/src/RestructuredText/TextRoles/AbbreviationTextRole.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ final class AbbreviationTextRole extends BaseTextRole
3434
{
3535
protected string $name = 'abbreviation';
3636

37+
/** @return string[] */
38+
public function getAliases(): array
39+
{
40+
return ['abbr'];
41+
}
42+
3743
public function __construct(
3844
private readonly LoggerInterface $logger,
3945
) {

tests/Functional/tests/text-roles/text-roles.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<p><code>Default interpreted text</code></p>
22
<p><code>Lorem Ipsum</code></p>
33
<p><abbr title="last-in, first-out">LIFO</abbr></p>
4+
<p><abbr title="Pretty Good Privacy">PGP</abbr></p>
45
<p><em class="aspect">Some important aspect</em></p>
56
<p><code>result = (1 + x) * 32</code></p>
67
<p><strong class="command">rm</strong></p>

tests/Functional/tests/text-roles/text-roles.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
:abbreviation:`LIFO (last-in, first-out)`
66

7+
:abbr:`PGP (Pretty Good Privacy)`
8+
79
:aspect:`Some important aspect`
810

911
:code:`result = (1 + x) * 32`

0 commit comments

Comments
 (0)