Skip to content

Commit a39cc61

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.
1 parent c9008d7 commit a39cc61

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

news/changelog-1.9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ All changes included in 1.9:
99
- ([#13616](https://github.com/quarto-dev/quarto-cli/issues/13616)): Fix fatal error when rendering manuscript projects with custom blocks like ConditionalBlock.
1010
- ([#13625](https://github.com/quarto-dev/quarto-cli/issues/13625)): Fix Windows file locking error (os error 32) when rendering with `--output-dir` flag. Context cleanup now happens before removing the temporary `.quarto` directory, ensuring file handles are properly closed.
1111
- ([#13633](https://github.com/quarto-dev/quarto-cli/issues/13633)): Fix detection and auto-installation of babel language packages from newer error format that doesn't explicitly mention `.ldf` filename.
12+
- ([#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.
1213

1314
## Dependencies
1415

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)