1
0
mirror of synced 2025-12-23 21:07:12 -05:00
This commit is contained in:
Sarah Schneider
2021-05-19 12:05:05 -04:00
parent 4da2a8e7c0
commit 2a72558592
2 changed files with 2 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ module.exports = function currentProductTree (req, res, next) {
req.context.currentProductTree = currentSiteTree.childPages.find(page => {
// Find a product path that matches at least an initial part of the current path
const regex = new RegExp(`^${page.href}($|\/)`, 'm')
const regex = new RegExp(`^${page.href}($|/)`, 'm')
return regex.test(req.context.currentPath)
})

View File

@@ -24,7 +24,7 @@ module.exports = async function genericToc (req, res, next) {
function findPageInSiteTree (pageArray, currentPath) {
const childPage = pageArray.find(page => {
// Find a page that matches at least an initial part of the current path
const regex = new RegExp(`^${page.href}($|\/)`, 'm')
const regex = new RegExp(`^${page.href}($|/)`, 'm')
return regex.test(currentPath)
})