Improve find by tracking actual rendered text (#9419)

* Improve find by tracking actual rendered text

* Fix tests, add notebook md render
This commit is contained in:
Chris LaFreniere
2020-03-03 16:56:11 -08:00
committed by GitHub
parent ff0992510b
commit 0f9d98730e
5 changed files with 46 additions and 3 deletions

View File

@@ -200,6 +200,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
this.setLoading(false);
let outputElement = <HTMLElement>this.output.nativeElement;
outputElement.innerHTML = this.markdownResult.element.innerHTML;
this.cellModel.renderedOutputTextContent = this.getRenderedTextOutput();
}
}
@@ -331,4 +332,17 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
}
return children;
}
private getRenderedTextOutput(): string[] {
let textOutput: string[] = [];
let elements = this.getHtmlElements();
elements.forEach(element => {
if (element && element.innerText) {
textOutput.push(element.innerText);
} else {
textOutput.push('');
}
});
return textOutput;
}
}