remove images from metadata on source update (#15640)

* remove images from metadata on update

* update comment

* reset only on html update

* add comment

* fixes

Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
Maddy
2021-06-21 13:55:37 -07:00
committed by GitHub
parent adbf40859f
commit 90b90afeab
3 changed files with 8 additions and 2 deletions

View File

@@ -272,6 +272,8 @@ 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();
}