File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ;
Original file line number Diff line number Diff 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+
8289function 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 }
You can’t perform that action at this time.
0 commit comments