mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 19:28:39 +00:00
Load fonts before running screenshotter (#1891)
This commit is contained in:
@@ -384,18 +384,17 @@ function takeScreenshot(key) {
|
||||
|
||||
function loadMath() {
|
||||
if (!opts.reload && driverReady) {
|
||||
driver.executeAsyncScript(
|
||||
"var callback = arguments[arguments.length - 1]; " +
|
||||
driver.executeScript(
|
||||
"handle_search_string(" +
|
||||
JSON.stringify("?" + itm.query) + ", callback);")
|
||||
JSON.stringify("?" + itm.query) + ");")
|
||||
.then(waitThenScreenshot);
|
||||
} else if (opts.coverage) {
|
||||
// collect coverage before reloading
|
||||
collectCoverage().then(function() {
|
||||
return driver.get(url).then(waitThenScreenshot);
|
||||
return driver.get(url).then(loadFonts);
|
||||
});
|
||||
} else {
|
||||
driver.get(url).then(waitThenScreenshot);
|
||||
driver.get(url).then(loadFonts);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,6 +407,13 @@ function takeScreenshot(key) {
|
||||
});
|
||||
}
|
||||
|
||||
function loadFonts() {
|
||||
driver.executeAsyncScript(
|
||||
"var callback = arguments[arguments.length - 1]; " +
|
||||
"load_fonts(callback);")
|
||||
.then(waitThenScreenshot);
|
||||
}
|
||||
|
||||
function waitThenScreenshot() {
|
||||
driverReady = true;
|
||||
if (opts.wait) {
|
||||
|
Reference in New Issue
Block a user