@@ -106,6 +106,7 @@ export function createUriListSnippet(
106
106
107
107
let insertedLinkCount = 0 ;
108
108
let insertedImageCount = 0 ;
109
+ let insertedAudioVideoCount = 0 ;
109
110
110
111
uris . forEach ( ( uri , i ) => {
111
112
const mdPath = getMdPath ( dir , uri ) ;
@@ -116,12 +117,12 @@ export function createUriListSnippet(
116
117
const insertAsAudio = mediaFileExtensions . get ( ext ) === MediaKind . Audio ;
117
118
118
119
if ( insertAsVideo ) {
119
- insertedImageCount ++ ;
120
+ insertedAudioVideoCount ++ ;
120
121
snippet . appendText ( `<video src="${ mdPath } " controls title="` ) ;
121
122
snippet . appendPlaceholder ( 'Title' ) ;
122
123
snippet . appendText ( '"></video>' ) ;
123
124
} else if ( insertAsAudio ) {
124
- insertedImageCount ++ ;
125
+ insertedAudioVideoCount ++ ;
125
126
snippet . appendText ( `<audio src="${ mdPath } " controls title="` ) ;
126
127
snippet . appendPlaceholder ( 'Title' ) ;
127
128
snippet . appendText ( '"></audio>' ) ;
@@ -147,7 +148,13 @@ export function createUriListSnippet(
147
148
} ) ;
148
149
149
150
let label : string ;
150
- if ( insertedImageCount > 0 && insertedLinkCount > 0 ) {
151
+ if ( insertedAudioVideoCount > 0 ) {
152
+ if ( insertedLinkCount > 0 ) {
153
+ label = vscode . l10n . t ( 'Insert Markdown Media and Links' ) ;
154
+ } else {
155
+ label = vscode . l10n . t ( 'Insert Markdown Media' ) ;
156
+ }
157
+ } else if ( insertedImageCount > 0 && insertedLinkCount > 0 ) {
151
158
label = vscode . l10n . t ( 'Insert Markdown Images and Links' ) ;
152
159
} else if ( insertedImageCount > 0 ) {
153
160
label = insertedImageCount > 1
0 commit comments