Fix relref regression with trailing slash

Fixes #12096
This commit is contained in:
Bjørn Erik Pedersen
2024-02-21 15:42:00 +01:00
parent 6da1d8f370
commit fd0185a84a
2 changed files with 24 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ func (c *pageFinder) getPageRef(context page.Page, ref string) (page.Page, error
}
func (c *pageFinder) getPage(context page.Page, ref string) (page.Page, error) {
n, err := c.getContentNode(context, false, paths.ToSlashTrimTrailing(ref))
n, err := c.getContentNode(context, false, ref)
if err != nil {
return nil, err
}
@@ -121,6 +121,7 @@ func (c *pageFinder) getPageForRefs(ref ...string) (page.Page, error) {
const defaultContentExt = ".md"
func (c *pageFinder) getContentNode(context page.Page, isReflink bool, ref string) (contentNodeI, error) {
ref = paths.ToSlashTrimTrailing(ref)
inRef := ref
if ref == "" {
ref = "/"