Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All changes included in 1.6:

## `dashboard` Format

- ([#9411](https://github.com/quarto-dev/quarto-cli/issues/9411)): Fix issue with history navigation in dashboards and external links.
- ([#10340](https://github.com/quarto-dev/quarto-cli/issues/10340)): Build card title correctly in the presence of equations and other markup.

## `html` Format
Expand Down
12 changes: 12 additions & 0 deletions src/resources/formats/dashboard/quarto-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,20 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
const linkEls = document.querySelectorAll(
".quarto-dashboard-content a:not(.nav-link)"
);
const currentUrl = new URL(window.location.href);
for (const linkEl of linkEls) {
const linkHref = linkEl.getAttribute("href");
// https://github.com/quarto-dev/quarto-cli/issues/9411
// only add the event listener for internal links
try {
const linkUrl = new URL(linkHref);
if (linkUrl.origin !== currentUrl.origin) {
continue;
}
} catch (_e) {
// if the link is not a valid URL, skip it
continue;
}
linkEl.addEventListener("click", () => {
QuartoDashboardUtils.showPage(linkHref);
return false;
Expand Down
Loading