Skip to content

Commit 495b21f

Browse files
authored
Merge branch 'main' into speed-up-parser
2 parents dcc984e + 2670ac4 commit 495b21f

File tree

10 files changed

+71
-8
lines changed

10 files changed

+71
-8
lines changed

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/contributions/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,13 @@ Clone the mono repository
1010
Run the tests
1111
=============
1212

13+
The project comes with a Makefile that will run the tests and other
14+
checks for you.
15+
It relies on ``docker``, but you can run any make target natively by
16+
using the ``PHP_BIN`` make variable.
17+
For instance, to run the pre-commit checks, you can run::
18+
19+
make PHP_BIN=php pre-commit-test
20+
1321
Submit a Pull Request
1422
=====================

packages/guides/src/ReferenceResolvers/DocReferenceResolver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public function resolve(LinkInlineNode $node, RenderContext $renderContext): boo
1818
return false;
1919
}
2020

21-
$document = $renderContext->getProjectNode()->findDocumentEntry($node->getTargetReference());
21+
$document = $renderContext->getProjectNode()->findDocumentEntry(
22+
$renderContext->canonicalUrl($node->getTargetReference()),
23+
);
2224
if ($document === null) {
2325
return false;
2426
}

packages/guides/src/RenderContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getLink(string $name, bool $relative = true): string
9494
return '';
9595
}
9696

97-
public function canonicalUrl(string $url): string|null
97+
public function canonicalUrl(string $url): string
9898
{
9999
return $this->urlGenerator->canonicalUrl($this->getDirName(), $url);
100100
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Root</title>
5+
6+
</head>
7+
<body>
8+
<div class="section" id="root">
9+
<h1>Root</h1>
10+
11+
</div>
12+
13+
</body>
14+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Subfolder index</title>
5+
6+
</head>
7+
<body>
8+
<div class="section" id="subfolder-index">
9+
<h1>Subfolder index</h1>
10+
11+
<p><a href="/index.html">Root</a></p>
12+
</div>
13+
14+
</body>
15+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
====
2+
Root
3+
====
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
===============
2+
Subfolder index
3+
===============
4+
5+
:doc:`../index`
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title></title>
5+
6+
</head>
7+
<body>
8+
<p><a href="/page.html">Page 1</a></p>
9+
</body>
10+
</html>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
===============
2+
Subfolder index
3+
===============
4+
5+
6+
:doc:`../page`

0 commit comments

Comments
 (0)