Skip to content

Commit 8a622eb

Browse files
authored
& in breadcrumbs instead of & (github#26101)
1 parent 7850f08 commit 8a622eb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

middleware/contextualizers/breadcrumbs.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ async function getBreadcrumbs(req) {
3939
}
4040

4141
async function getShortTitle(page, context) {
42+
// Note! Don't use `page.title` or `page.shortTitle` because if they get
43+
// set during rendering, they become the HTML entities encoded string.
44+
// E.g. "Delete & restore a package"
45+
4246
if (page.rawShortTitle) {
4347
if (page.rawShortTitle.includes('{')) {
4448
// Can't easily cache this because the `page` is reused for multiple
@@ -47,10 +51,10 @@ async function getShortTitle(page, context) {
4751
// this point it's probably not worth it.
4852
return await liquid.parseAndRender(page.rawShortTitle, context)
4953
}
50-
return page.shortTitle
54+
return page.rawShortTitle
5155
}
5256
if (page.rawTitle.includes('{')) {
5357
return await liquid.parseAndRender(page.rawTitle, context)
5458
}
55-
return page.title
59+
return page.rawTitle
5660
}

0 commit comments

Comments
 (0)