-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static pages do not have an source to find references, so static html links are used. Guides does see them as invalid links. This new resolver allows us to accept the static links as valid and uses the targetreference as url.
- Loading branch information
Showing
4 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Website\Guides\ReferenceResolver; | ||
|
||
use phpDocumentor\Guides\Nodes\Inline\LinkInlineNode; | ||
use phpDocumentor\Guides\ReferenceResolvers\Messages; | ||
use phpDocumentor\Guides\ReferenceResolvers\ReferenceResolver; | ||
use phpDocumentor\Guides\RenderContext; | ||
|
||
use function str_ends_with; | ||
|
||
class HtmlResolver implements ReferenceResolver | ||
{ | ||
public function resolve(LinkInlineNode $node, RenderContext $renderContext, Messages $messages): bool | ||
{ | ||
if (str_ends_with($node->getTargetReference(), '.html')) { | ||
$node->setUrl($node->getTargetReference()); | ||
|
||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
public static function getPriority(): int | ||
{ | ||
return -300; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ issue tracker in GitHub and don't publish it publicly. Instead, all security iss | |
must be sent to `[email protected] <mailto:[email protected]>`_. | ||
Emails sent to this address are forwarded to the Doctrine core team private mailing-list. | ||
|
||
.. notice:: | ||
.. note:: | ||
|
||
While we are working on a patch, please do not reveal the issue publicly. The resolution can take | ||
anywhere between a couple of days, a month or an indefinite amount of time depending on its complexity. | ||
|