From 74c301eadec94d9a4fc7d4814e3a050d8b82d237 Mon Sep 17 00:00:00 2001 From: Olivier Benz Date: Mon, 21 Nov 2022 15:11:53 +0100 Subject: [PATCH 1/3] Correct redirect for code-server --- news/changelog-1.3.md | 4 ++++ src/command/preview/preview.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/news/changelog-1.3.md b/news/changelog-1.3.md index 3209fe39f1..1a68de9530 100644 --- a/news/changelog-1.3.md +++ b/news/changelog-1.3.md @@ -54,6 +54,10 @@ - Remove chapter number of HTML head title when `number-sections` is `false` (#3304). +## Preview + +- Correct redirect for code-server (#3352) + ## Miscellaneous - Work around pandoc strict checking of `number-offset` type. ([#3126](https://github.com/quarto-dev/quarto-cli/issues/3126)) diff --git a/src/command/preview/preview.ts b/src/command/preview/preview.ts index 35edcb27db..f8e096b08a 100644 --- a/src/command/preview/preview.ts +++ b/src/command/preview/preview.ts @@ -72,6 +72,8 @@ import { isJupyterHubServer, isRStudioServer, isRStudioWorkbench, + isVSCodeServer, + vsCodeServerProxyUri, } from "../../core/platform.ts"; import { isJupyterNotebook } from "../../core/jupyter/jupyter.ts"; import { watchForFileChanges } from "../../core/watch.ts"; @@ -690,6 +692,9 @@ function pdfFileRequestHandler( if (new URL(req.url).pathname === "/") { const url = isRStudioWorkbench() ? await rswURL(port, kPdfJsInitialPath) + : isVSCodeServer() + ? vsCodeServerProxyUri()!.replace("{{port}}", `${port}`) + + kPdfJsInitialPath : "/" + kPdfJsInitialPath; return Promise.resolve(serveRedirect(url)); } else { From a63177bd5f8ca5eafd25c890625815239d11388f Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger <285675+cscheid@users.noreply.github.com> Date: Mon, 21 Nov 2022 08:46:15 -0700 Subject: [PATCH 2/3] Improve changelog description --- news/changelog-1.3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/changelog-1.3.md b/news/changelog-1.3.md index 1a68de9530..3cc5eabc39 100644 --- a/news/changelog-1.3.md +++ b/news/changelog-1.3.md @@ -56,7 +56,7 @@ ## Preview -- Correct redirect for code-server (#3352) +- Correct redirect for VS Code Server (#3352) ## Miscellaneous From 735f1e9309412bc8e4b7616c8a2b79957c7a777e Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger <285675+cscheid@users.noreply.github.com> Date: Mon, 21 Nov 2022 08:49:52 -0700 Subject: [PATCH 3/3] Add PR author ack. --- news/changelog-1.3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/changelog-1.3.md b/news/changelog-1.3.md index 3cc5eabc39..202bfdd1bd 100644 --- a/news/changelog-1.3.md +++ b/news/changelog-1.3.md @@ -56,7 +56,7 @@ ## Preview -- Correct redirect for VS Code Server (#3352) +- Correct redirect for VS Code Server (#3352) (Thank you, @benz0li!) ## Miscellaneous