Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): open document file links in the correct viewer #16071

ClosedJDeffner(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/16071/headopened View on GitHub

Showing 12 changed files with 14 additions and 4 deletions (loading 9).

x
0 of 12 viewed, 12 left
11 additions and 0 deletionsapps/mobile/src/lib/markdownLinks.test.tsModified
View file
@@ -99,6 +99,17 @@
});
});
​
+ it("presents a bare Unicode file link as an actionable file", () => {
+ const path = "線性代數/期中 報告.pdf";
+ const href = encodeURI(path);
+ expect(resolveMarkdownLinkPresentation(href)).toMatchObject({
+ kind: "file",
+ href,
+ path,
+ label: "期中 報告.pdf",
+ });
+ });
+​
it("extracts line fragments from relative file links", () => {
expect(resolveMarkdownLinkPresentation("src/main.ts#L18C2")).toMatchObject({
kind: "file",
1 addition and 2 deletionsapps/web/src/browser/openFileInPreview.tsModified
View file
@@ -29,8 +29,7 @@
resolveBrowserDefaults,
} from "./browserDefaults";
​
-export const isBrowserPreviewFile = (path: string): boolean =>
- /\.(?:html?|pdf)$/i.test(path.split(/[?#]/, 1)[0] ?? "");
+export { isWorkspaceBrowserPreviewPath as isBrowserPreviewFile } from "@t3tools/shared/filePreview";
​