mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
Revert "Remove trailing commas for IE 9 compatibility"
This reverts commit 4d2e46e7f6
.
Having trailing commans makes diffs easier to read as it avoids modifying a
line just to add a trailing comma if there is another item to add at the end
of a list. There are plans to switch to ES6 notation and to translate that
to ES5 as part of the build process. Since that translation would remove
trailing commas, the IE9 problems that originally motivated the commit
should vanish soon.
This commit is contained in:
@@ -25,52 +25,52 @@ var opts = require("nomnom")
|
||||
.option("browser", {
|
||||
abbr: "b",
|
||||
"default": "firefox",
|
||||
help: "Name of the browser to use"
|
||||
help: "Name of the browser to use",
|
||||
})
|
||||
.option("container", {
|
||||
abbr: "c",
|
||||
type: "string",
|
||||
help: "Name or ID of a running docker container to contact"
|
||||
help: "Name or ID of a running docker container to contact",
|
||||
})
|
||||
.option("seleniumURL", {
|
||||
full: "selenium-url",
|
||||
help: "Full URL of the Selenium web driver"
|
||||
help: "Full URL of the Selenium web driver",
|
||||
})
|
||||
.option("seleniumIP", {
|
||||
full: "selenium-ip",
|
||||
help: "IP address of the Selenium web driver"
|
||||
help: "IP address of the Selenium web driver",
|
||||
})
|
||||
.option("seleniumPort", {
|
||||
full: "selenium-port",
|
||||
"default": 4444,
|
||||
help: "Port number of the Selenium web driver"
|
||||
help: "Port number of the Selenium web driver",
|
||||
})
|
||||
.option("katexURL", {
|
||||
full: "katex-url",
|
||||
help: "Full URL of the KaTeX development server"
|
||||
help: "Full URL of the KaTeX development server",
|
||||
})
|
||||
.option("katexIP", {
|
||||
full: "katex-ip",
|
||||
help: "Full URL of the KaTeX development server"
|
||||
help: "Full URL of the KaTeX development server",
|
||||
})
|
||||
.option("katexPort", {
|
||||
full: "katex-port",
|
||||
help: "Port number of the KaTeX development server"
|
||||
help: "Port number of the KaTeX development server",
|
||||
})
|
||||
.option("include", {
|
||||
abbr: "i",
|
||||
help: "Comma-separated list of test cases to process"
|
||||
help: "Comma-separated list of test cases to process",
|
||||
})
|
||||
.option("exclude", {
|
||||
abbr: "x",
|
||||
help: "Comma-separated list of test cases to exclude"
|
||||
help: "Comma-separated list of test cases to exclude",
|
||||
})
|
||||
.option("verify", {
|
||||
flag: true,
|
||||
help: "Check whether screenshot matches current file content"
|
||||
help: "Check whether screenshot matches current file content",
|
||||
})
|
||||
.option("wait", {
|
||||
help: "Wait this many seconds between page load and screenshot"
|
||||
help: "Wait this many seconds between page load and screenshot",
|
||||
})
|
||||
.parse();
|
||||
|
||||
@@ -208,7 +208,7 @@ function tryConnect() {
|
||||
}
|
||||
var sock = net.connect({
|
||||
host: seleniumIP,
|
||||
port: +seleniumPort
|
||||
port: +seleniumPort,
|
||||
});
|
||||
sock.on("connect", function() {
|
||||
sock.end();
|
||||
@@ -278,7 +278,7 @@ function imageDimensions(img) {
|
||||
return {
|
||||
buf: buf,
|
||||
width: buf.readUInt32BE(16),
|
||||
height: buf.readUInt32BE(20)
|
||||
height: buf.readUInt32BE(20),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ function takeScreenshot(key) {
|
||||
}
|
||||
}
|
||||
var opt = new jspngopt.Optimizer({
|
||||
pako: pako
|
||||
pako: pako,
|
||||
});
|
||||
var buf = opt.bufferSync(img.buf);
|
||||
if (loadExpected) {
|
||||
|
@@ -49,7 +49,7 @@ Q.all([
|
||||
readFile(path.join(ssDir, "test.tex"), "utf-8"),
|
||||
ensureDir(tmpDir),
|
||||
ensureDir(teximgDir),
|
||||
ensureDir(diffDir)
|
||||
ensureDir(diffDir),
|
||||
]).spread(function(data) {
|
||||
template = data;
|
||||
// dirs have been created, template has been read, now rasterize.
|
||||
@@ -80,14 +80,14 @@ function processTestCase(key) {
|
||||
var fftLatex = writeFile(texFile, tex).then(function() {
|
||||
// Step 2: call "pdflatex key" to create key.pdf
|
||||
return execFile("pdflatex", [
|
||||
"-interaction", "nonstopmode", key
|
||||
"-interaction", "nonstopmode", key,
|
||||
], {cwd: tmpDir});
|
||||
}).then(function() {
|
||||
console.log("Typeset " + key);
|
||||
// Step 3: call "convert ... key.pdf key.png" to create key.png
|
||||
return execFile("convert", [
|
||||
"-density", dpi, "-units", "PixelsPerInch", "-flatten",
|
||||
"-depth", "8", pdfFile, pngFile
|
||||
"-depth", "8", pdfFile, pngFile,
|
||||
]);
|
||||
}).then(function() {
|
||||
console.log("Rasterized " + key);
|
||||
@@ -168,7 +168,7 @@ function processTestCase(key) {
|
||||
// First image is red, second green, third blue channel of result
|
||||
"-channel", "RGB", "-combine",
|
||||
"-trim", // remove everything with the same color as the corners
|
||||
diffFile // output file name
|
||||
diffFile, // output file name
|
||||
]);
|
||||
}).then(function() {
|
||||
console.log("Compared " + key);
|
||||
@@ -245,7 +245,7 @@ function fftImage(image) {
|
||||
real: real,
|
||||
imag: imag,
|
||||
width: image.width,
|
||||
height: image.height
|
||||
height: image.height,
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user