Skip to content

Commit bd883ec

Browse files
committed
[BUGFIX] Anchor References may not have an interlink part
Otherwise, references to an unknown interlink reference get rendered as if they are an internal anchor link. Resolves #837
1 parent da136e1 commit bd883ec

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

packages/guides/src/ReferenceResolvers/AnchorReferenceResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(
3535

3636
public function resolve(LinkInlineNode $node, RenderContext $renderContext, Messages $messages): bool
3737
{
38-
if (!$node instanceof ReferenceNode) {
38+
if (!$node instanceof ReferenceNode || $node->getInterlinkDomain() !== '') {
3939
return false;
4040
}
4141

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- content start -->
2+
<div class="section" id="document-title">
3+
<a id="doc"></a>
4+
<h1>Document Title</h1>
5+
6+
<p>Lorem Ipsum Dolor.</p>
7+
<p>See the TYPO3 documentation!</p>
8+
</div>
9+
10+
<!-- content end -->
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app.WARNING: Inventory with key unknowninventory not found.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
.. _doc:
3+
4+
==============
5+
Document Title
6+
==============
7+
8+
Lorem Ipsum Dolor.
9+
10+
See the :ref:`TYPO3 documentation <unknowninventory:doc>`!
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<guides xmlns="https://www.phpdoc.org/guides"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://www.phpdoc.org/guides packages/guides-cli/resources/schema/guides.xsd"
5+
>
6+
<project title="My Project" version="main (development)" />
7+
<inventory id="t3coreapi" url="https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/" />
8+
</guides>

0 commit comments

Comments
 (0)