Skip to content

Commit

Permalink
Takes PR and adds additional logic to include a regex to remove any d…
Browse files Browse the repository at this point in the history
…ouble slashes.
  • Loading branch information
dniccum committed Mar 1, 2023
1 parent 1785175 commit 038ed5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Library/Contracts/DocumentationPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ public function __construct($file, string $route, PageContent $content, bool $is
$this->route = "";
} else {
if ($content->path) {
$this->route = "/" . $content->path;
$this->route = "/$content->path";
} else {
$this->route = "/$route";
}
}
$this->route = preg_replace('/([^:])(\/{2,})/', '$1/', $this->route);

if ($content->title) {
$this->title = $content->title;
$this->pageTitle = $content->title;
Expand Down

0 comments on commit 038ed5a

Please sign in to comment.