Skip to content

Commit 7e54afa

Browse files
committed
minor
1 parent 32339ba commit 7e54afa

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Copyright 2025, Command Line Inc.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
export const CurrentOnboardingVersion = "v0.12.1";
4+
export const CurrentOnboardingVersion = "v0.12.1";

frontend/app/view/preview/preview-model.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ function isStreamingType(mimeType: string): boolean {
7979
);
8080
}
8181

82+
function isMarkdownLike(mimeType: string): boolean {
83+
if (mimeType == null) {
84+
return false;
85+
}
86+
return mimeType.startsWith("text/markdown") || mimeType.startsWith("text/mdx");
87+
}
88+
8289
function iconForFile(mimeType: string): string {
8390
if (mimeType == null) {
8491
mimeType = "unknown";
@@ -91,7 +98,7 @@ function iconForFile(mimeType: string): string {
9198
return "film";
9299
} else if (mimeType.startsWith("audio/")) {
93100
return "headphones";
94-
} else if (mimeType.startsWith("text/markdown")) {
101+
} else if (isMarkdownLike(mimeType)) {
95102
return "file-lines";
96103
} else if (mimeType == "text/csv") {
97104
return "file-csv";
@@ -333,7 +340,7 @@ export class PreviewModel implements ViewModel {
333340
click: () => this.refreshCallback?.(),
334341
},
335342
] as IconButtonDecl[];
336-
} else if (!isCeView && mimeType?.startsWith("text/markdown")) {
343+
} else if (!isCeView && isMarkdownLike(mimeType)) {
337344
return [
338345
{
339346
elemtype: "iconbutton",
@@ -508,7 +515,7 @@ export class PreviewModel implements ViewModel {
508515
}
509516
return { specializedView: "csv" };
510517
}
511-
if (mimeType.startsWith("text/markdown") || mimeType.startsWith("text/mdx")) {
518+
if (isMarkdownLike(mimeType)) {
512519
if (editMode) {
513520
return { specializedView: "codeedit" };
514521
}

0 commit comments

Comments
 (0)