Skip to content

Commit 4db475a

Browse files
committed
fix(live-preview): navigate popped-out tabs to markdown files
The mdviewr branch in _loadPreview returned before reaching the StaticServer.redirectAllTabs call that the HTML branch makes, so popped-out preview windows stopped following along when the user switched to a markdown file. Broadcast the URL change in the markdown branch too — popped-out tabs render the legacy server-side markdown URL while the embedded panel keeps using mdviewr.
1 parent 37140fc commit 4db475a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • src/extensionsIntegrated/Phoenix-live-preview

src/extensionsIntegrated/Phoenix-live-preview/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,10 @@ define(function (require, exports, module) {
10081008
// Use mdviewr for markdown files (unless custom server is configured)
10091009
if(previewDetails.isMarkdownFile && !previewDetails.isCustomServer && !previewDetails.isNoPreview) {
10101010
_loadMdviewrPreview(previewDetails, force);
1011+
// Embedded panel uses mdviewr above; popped-out tabs still render
1012+
// the legacy server-rendered markdown URL, so broadcast the URL
1013+
// change so they navigate too — same path as the HTML branch.
1014+
StaticServer.redirectAllTabs(currentLivePreviewURL, force);
10111015
return;
10121016
}
10131017
// Switching away from mdviewr to non-markdown preview

0 commit comments

Comments
 (0)