Open file preview markdown links in external browser

FilePreviewMarkdownLink was using Linking.openURL directly, which on
web/Electron performs a plain navigation that opens inside the app
window. Use openExternalUrl instead so desktop builds route through
the preload bridge to shell.openExternal.
This commit is contained in:
Mohamed Boudra
2026-06-09 13:28:05 +07:00
parent 378f1986ac
commit bed8af7aa6
+2 -2
View File
@@ -9,7 +9,6 @@ import Markdown, {
import {
ActivityIndicator,
Image as RNImage,
Linking,
ScrollView as RNScrollView,
Text,
type TextProps,
@@ -25,6 +24,7 @@ import { useIsCompactFormFactor } from "@/constants/layout";
import { useSessionStore, type ExplorerFile } from "@/stores/session-store";
import { useWebScrollViewScrollbar } from "@/components/use-web-scrollbar";
import { useWebScrollbarStyle } from "@/hooks/use-web-scrollbar-style";
import { openExternalUrl } from "@/utils/open-external-url";
import { highlightCode, type HighlightToken } from "@getpaseo/highlight";
import { syntaxTokenStyleFor } from "@/styles/syntax-token-styles";
import { inlineUnistylesStyle } from "@/styles/unistyles-inline-style";
@@ -208,7 +208,7 @@ function FilePreviewMarkdownLink({
const handlePress = useCallback(() => {
if (!href) return;
if (onLinkPress?.(href) === false) return;
void Linking.openURL(href);
void openExternalUrl(href);
}, [href, onLinkPress]);
return (