mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
Pass element to the JS preEvaluate renderer hook (#160851)
This commit is contained in:
@@ -25,7 +25,7 @@ interface JavaScriptRenderingHook {
|
||||
*
|
||||
* @return A new string of JavaScript or `undefined` to continue using the provided string.
|
||||
*/
|
||||
preEvaluate(outputItem: OutputItem, element: string, signal: AbortSignal): string | undefined | Promise<string | undefined>;
|
||||
preEvaluate(outputItem: OutputItem, element: HTMLElement, script: string, signal: AbortSignal): string | undefined | Promise<string | undefined>;
|
||||
}
|
||||
|
||||
function clearContainer(container: HTMLElement) {
|
||||
@@ -103,7 +103,7 @@ async function renderJavascript(outputInfo: OutputItem, container: HTMLElement,
|
||||
let scriptText = outputInfo.text();
|
||||
|
||||
for (const hook of hooks) {
|
||||
scriptText = (await hook.preEvaluate(outputInfo, scriptText, signal)) ?? scriptText;
|
||||
scriptText = (await hook.preEvaluate(outputInfo, container, scriptText, signal)) ?? scriptText;
|
||||
if (signal.aborted) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user