Skip to content

Commit 3c11f40

Browse files
committed
Update test results with the latest formats
1 parent c49ef21 commit 3c11f40

File tree

8 files changed

+22
-18
lines changed

8 files changed

+22
-18
lines changed

packages/guides/src/Compiler/DocumentNodeTraverser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private function traverseForTransformer(
5050
}
5151

5252
foreach ($shadowNode->getChildren() as $shadowChild) {
53-
$this->traverseForTransformer($transformer, $shadowChild, $compilerContext->withShadowTree($shadowNode));
53+
$this->traverseForTransformer($transformer, $shadowChild, $compilerContext->withShadowTree($shadowChild));
5454
}
5555

5656
if (!$supports) {

packages/guides/src/Compiler/NodeTransformers/CollectLinkTargetsTransformer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ public function enterNode(Node $node, CompilerContext $compilerContext): Node
3535
if ($node instanceof DocumentNode) {
3636
$this->documentStack->push($node);
3737
} elseif ($node instanceof AnchorNode) {
38-
$currentDocument = $this->documentStack->top();
39-
Assert::notNull($currentDocument);
38+
$currentDocument = $compilerContext->getDocumentNode();
39+
$parentSection = $compilerContext->getShadowTree()->getParent()->getNode();
40+
assert($parentSection instanceof SectionNode);
4041

4142
$compilerContext->getProjectNode()->addLinkTarget(
4243
$node->toString(),

packages/guides/src/Compiler/NodeTransformers/MoveAnchorTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function leaveNode(Node $node, CompilerContext $compilerContext): Node|nu
2727
}
2828

2929
$this->seen[spl_object_hash($node)] = spl_object_hash($node);
30-
$parent = $compilerContext->getShadowTree();
30+
$parent = $compilerContext->getShadowTree()->getParent();
3131
$position = $parent->findPosition($node);
3232
if ($position === null) {
3333
throw new LogicException('Node not found in shadow tree');

tests/Integration/tests/anchor-to-title/expected/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ <h1>Overview</h1>
1010
<a id="rst-overview"></a>
1111
<p>RST Overview content</p>
1212
</div>
13-
<div class="section" id="overview">
13+
<div class="section" id="overview-1">
1414
<h1>Overview</h1>
1515
<a id="sphinx-overview"></a>
1616
<p>Sphinx Overview content</p>

tests/Integration/tests/anchor-whitespace/expected/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
4-
<meta charset="utf-8"/>
5-
6-
4+
<title>Overview</title>
75
</head>
86

97
<body>
10-
<div class="section" id="rst-overview">
8+
<div class="section" id="overview">
119
<h1>Overview</h1>
10+
<a id="rst-overview"></a>
1211
<p>RST Overview content</p>
1312
</div>
14-
<div class="section" id="sphinx-overview">
13+
<div class="section" id="overview-1">
1514
<h1>Overview</h1>
15+
<a id="sphinx-overview"></a>
1616
<p>Sphinx Overview content</p>
1717
<div class="section" id="somewhere-else">
1818
<h2>Somewhere else</h2>

tests/Integration/tests/anchor-whitespace/input/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ Sphinx Overview content
1616
Somewhere else
1717
=============
1818

19-
This is a link to the RST Overview :ref:`rst-overview`
19+
This is a link to the RST Overview: :ref:`rst-overview`
2020

21-
This is a link to the Sphinx Overview :ref:`sphinx-overview`
21+
This is a link to the Sphinx Overview: :ref:`sphinx-overview`

tests/Integration/tests/references/expected/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ <h1>Overview</h1>
99
<a id="RST Overview"></a>
1010
<p>RST Overview content</p>
1111
</div>
12-
<div class="section" id="overview">
12+
<div class="section" id="overview-1">
1313
<h1>Overview</h1>
1414
<a id="Other Overview"></a>
1515
<p>Other Overview content</p>
16-
<p>This is a link to the RST Overview<a href="/index.html#RST Overview">alternative</a></p>
17-
<p>This is a link to the Other Overview<a href="/index.html#Other Overview">Other Overview</a></p>
16+
<p>This is a link to the RST Overview: <a href="/index.html#RST Overview">alternative</a></p>
17+
<p>This is a link to the Other Overview: <a href="/index.html#Other Overview">Other Overview</a></p>
1818
<p>This is a link to <a href="/page.html">Page 1</a>
1919
This is a link to with alternative text <a href="/page.html">alternative</a></p>
2020
</div>
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<title></title>
4+
<title>Subfolder index</title>
55

66
</head>
77
<body>
8-
<p><a href="/page.html">Page 1</a></p>
8+
<div class="section" id="subfolder-index">
9+
<h1>Subfolder index</h1>
10+
<p><a href="/page.html">Page 1</a></p>
11+
</div>
912
</body>
1013
</html>

0 commit comments

Comments
 (0)