Skip to content

Commit

Permalink
Merge pull request #2 from potentweb/linkfix
Browse files Browse the repository at this point in the history
Path replacement fix.
  • Loading branch information
dniccum authored Mar 4, 2019
2 parents 8460530 + da4462c commit 075fe4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Library/MarkdownUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ private function getPageTitle(string $filePath): string
private function replaceLinks(string $htmlContent, array $otherOptions): string
{
$regex = "/<a.+href=['|\"](?!http|https)([^\"\']*)['|\"].*>(.+)<\/a>/i";
$output = preg_replace($regex,'<a href="/nova/documentation/\1">\2</a>',$htmlContent);
$output = preg_replace($regex,'<a href="'.config('nova.path').'/documentation/\1">\2</a>',$htmlContent);
$output = preg_replace("/(\.md|.text|.mdown|.mkdn|.mkd|.mdwn|mdtxt|.Rmd|.mdtext)/i",'"',$output);

return $output;
}
}
}

0 comments on commit 075fe4a

Please sign in to comment.