Skip to content

Commit 82013bd

Browse files
committed
Fix notebook-view.url being ignored
When notebook-view.url is specified, notebook links should point to the external URL instead of rendering a local preview. This was broken in v1.4.156 (commit faba735) when the notebook system was refactored and external URL handling was accidentally removed. The fix restores the check for descriptor?.url before falling back to the local preview path in format-html-notebook-preview.ts. Updated existing test to verify links contain the external URL. (cherry picked from commit a39cc61) Move changelog entry as backport in v1.8 # Conflicts: # news/changelog-1.9.md
1 parent bf70ee6 commit 82013bd

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

news/changelog-1.8.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## In this release
44

5+
- ([#13694](https://github.com/quarto-dev/quarto-cli/issues/13694)): Fix `notebook-view.url` being ignored - external notebook links now properly use specified URLs instead of local preview files.
6+
57
## In previous releases
68

79
- ([#13369](https://github.com/quarto-dev/quarto-cli/issues/13369)): Fix failure in theme compilation when `brand.color.primary` is specified for light or dark but not both.

src/format/html/format-html-notebook-preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export const notebookPreviewer = (
252252
// to form links to this notebook
253253
const nbPreview = {
254254
title: resolvedTitle,
255-
href: relative(inputDir, renderedNotebook[kHtmlPreview].hrefPath),
255+
href: descriptor?.url || relative(inputDir, renderedNotebook[kHtmlPreview].hrefPath),
256256
supporting,
257257
resources,
258258
order: work.order,

tests/docs/smoke-all/2023/01/05/notebook-preview-complex.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _quarto:
2929
tests:
3030
html:
3131
ensureHtmlElements:
32-
- ['a.quarto-notebook-link']
32+
- ['a.quarto-notebook-link[href*="kaggle.com"]']
3333
- ['div.quarto-alternate-notebooks a']
3434
ensureFileRegexMatches:
3535
- ['Source: TEST NB']

0 commit comments

Comments
 (0)