@@ -156,13 +156,13 @@ export class AttachmentCleaner implements vscode.CodeActionProvider {
156156 if ( this . checkMetadataAttachmentsExistence ( cell . metadata ) ) {
157157 // the cell metadata contains attachments, check if any are used in the markdown source
158158
159- for ( const currFilename of Object . keys ( cell . metadata . custom . attachments ) ) {
159+ for ( const currFilename of Object . keys ( cell . metadata . attachments ) ) {
160160 // means markdown reference is present in the metadata, rendering will work properly
161161 // therefore, we don't need to check it in the next loop either
162162 if ( markdownAttachmentsRefedInCell . has ( currFilename ) ) {
163163 // attachment reference is present in the markdown source, no need to cache it
164164 markdownAttachmentsRefedInCell . get ( currFilename ) ! . valid = true ;
165- markdownAttachmentsInUse [ currFilename ] = cell . metadata . custom . attachments [ currFilename ] ;
165+ markdownAttachmentsInUse [ currFilename ] = cell . metadata . attachments [ currFilename ] ;
166166 } else {
167167 // attachment reference is not present in the markdown source, cache it
168168 this . saveAttachmentToCache ( notebookUri , cellFragment , currFilename , cell . metadata ) ;
@@ -187,9 +187,9 @@ export class AttachmentCleaner implements vscode.CodeActionProvider {
187187 }
188188 }
189189
190- if ( ! objectEquals ( markdownAttachmentsInUse , cell . metadata . custom . attachments ) ) {
190+ if ( ! objectEquals ( markdownAttachmentsInUse , cell . metadata . attachments ) ) {
191191 const updateMetadata : { [ key : string ] : any } = deepClone ( cell . metadata ) ;
192- updateMetadata . custom . attachments = markdownAttachmentsInUse ;
192+ updateMetadata . attachments = markdownAttachmentsInUse ;
193193 const metadataEdit = vscode . NotebookEdit . updateCellMetadata ( cell . index , updateMetadata ) ;
194194 const workspaceEdit = new vscode . WorkspaceEdit ( ) ;
195195 workspaceEdit . set ( e . notebook . uri , [ metadataEdit ] ) ;
@@ -229,7 +229,7 @@ export class AttachmentCleaner implements vscode.CodeActionProvider {
229229 const markdownAttachments = this . getAttachmentNames ( document ) ;
230230 if ( this . checkMetadataAttachmentsExistence ( activeCell . metadata ) ) {
231231 for ( const [ currFilename , attachment ] of markdownAttachments ) {
232- if ( ! activeCell . metadata . custom . attachments [ currFilename ] ) {
232+ if ( ! activeCell . metadata . attachments [ currFilename ] ) {
233233 // no attachment reference in the metadata
234234 diagnostics . push ( { name : currFilename , ranges : attachment . ranges } ) ;
235235 }
@@ -287,7 +287,7 @@ export class AttachmentCleaner implements vscode.CodeActionProvider {
287287 * @returns
288288 */
289289 private getMetadataAttachment ( metadata : { [ key : string ] : any } , currFilename : string ) : { [ key : string ] : any } {
290- return metadata . custom . attachments [ currFilename ] ;
290+ return metadata . attachments [ currFilename ] ;
291291 }
292292
293293 /**
@@ -296,7 +296,7 @@ export class AttachmentCleaner implements vscode.CodeActionProvider {
296296 * @returns boolean representing the presence of any attachments
297297 */
298298 private checkMetadataAttachmentsExistence ( metadata : { [ key : string ] : any } ) : boolean {
299- return ! ! ( metadata . custom ?. attachments ) ;
299+ return ! ! ( metadata . attachments ) ;
300300 }
301301
302302 /**
@@ -311,8 +311,8 @@ export class AttachmentCleaner implements vscode.CodeActionProvider {
311311 const cellCache = documentCache . get ( cellFragment ) ?? new Map < string , IAttachmentData > ( ) ;
312312 documentCache . set ( cellFragment , cellCache ) ;
313313
314- for ( const currFilename of Object . keys ( metadata . custom . attachments ) ) {
315- cellCache . set ( currFilename , metadata . custom . attachments [ currFilename ] ) ;
314+ for ( const currFilename of Object . keys ( metadata . attachments ) ) {
315+ cellCache . set ( currFilename , metadata . attachments [ currFilename ] ) ;
316316 }
317317 }
318318
0 commit comments