Always clear unused attachments when updating cell source (#17840)

* Always clear unused attachments when updating cell source

* comment

* Fix eslint and improve regex

* Add more tests
This commit is contained in:
Charles Gagnon
2021-12-07 18:28:15 -08:00
committed by GitHub
parent 1651f3f8bc
commit 321a5b8a69
3 changed files with 108 additions and 2 deletions

View File

@@ -366,8 +366,6 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
private updateCellSource(): void {
let textOutputElement = <HTMLElement>this.output.nativeElement;
let newCellSource: string = this._htmlMarkdownConverter.convert(textOutputElement.innerHTML);
// reset cell attachments to remove unused image data since we're going to go through each of them again
this.cellModel.attachments = {};
this.cellModel.source = newCellSource;
this._changeRef.detectChanges();
}