Merge pull request #12551 from Snuffleupagus/no-useless-escape
Fix *some* errors reported by the ESLint `no-useless-escape` rule
This commit is contained in:
commit
bf870bd2ac
@ -1333,7 +1333,7 @@ class WidgetAnnotation extends Annotation {
|
|||||||
// 1.5 * capHeight * fontSize seems to be a good value for lineHeight
|
// 1.5 * capHeight * fontSize seems to be a good value for lineHeight
|
||||||
fontSize = Math.max(1, Math.floor(height / (1.5 * capHeight)));
|
fontSize = Math.max(1, Math.floor(height / (1.5 * capHeight)));
|
||||||
|
|
||||||
let fontRegex = new RegExp(`/${fontName}\\s+[0-9\.]+\\s+Tf`);
|
let fontRegex = new RegExp(`/${fontName}\\s+[0-9.]+\\s+Tf`);
|
||||||
if (this.data.defaultAppearance.search(fontRegex) === -1) {
|
if (this.data.defaultAppearance.search(fontRegex) === -1) {
|
||||||
// The font size is missing
|
// The font size is missing
|
||||||
fontRegex = new RegExp(`/${fontName}\\s+Tf`);
|
fontRegex = new RegExp(`/${fontName}\\s+Tf`);
|
||||||
|
@ -3415,8 +3415,8 @@ class PartialEvaluator {
|
|||||||
var baseFontStr = baseFont && baseFont.name;
|
var baseFontStr = baseFont && baseFont.name;
|
||||||
if (fontNameStr !== baseFontStr) {
|
if (fontNameStr !== baseFontStr) {
|
||||||
info(
|
info(
|
||||||
`The FontDescriptor\'s FontName is "${fontNameStr}" but ` +
|
`The FontDescriptor's FontName is "${fontNameStr}" but ` +
|
||||||
`should be the same as the Font\'s BaseFont "${baseFontStr}".`
|
`should be the same as the Font's BaseFont "${baseFontStr}".`
|
||||||
);
|
);
|
||||||
// Workaround for cases where e.g. fontNameStr = 'Arial' and
|
// Workaround for cases where e.g. fontNameStr = 'Arial' and
|
||||||
// baseFontStr = 'Arial,Bold' (needed when no font file is embedded).
|
// baseFontStr = 'Arial,Bold' (needed when no font file is embedded).
|
||||||
|
@ -110,8 +110,8 @@ class Field extends PDFObject {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
event.rc = false;
|
event.rc = false;
|
||||||
const value =
|
const value =
|
||||||
`\"${error.toString()}\" for event ` +
|
`"${error.toString()}" for event ` +
|
||||||
`\"${eventName}\" in object ${this._id}.` +
|
`"${eventName}" in object ${this._id}.` +
|
||||||
`\n${error.stack}`;
|
`\n${error.stack}`;
|
||||||
this._send({ command: "error", value });
|
this._send({ command: "error", value });
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,7 @@ class SimpleDOMNode {
|
|||||||
if (this.attributes) {
|
if (this.attributes) {
|
||||||
for (const attribute of this.attributes) {
|
for (const attribute of this.attributes) {
|
||||||
buffer.push(
|
buffer.push(
|
||||||
` ${attribute.name}=\"${encodeToXmlString(attribute.value)}\"`
|
` ${attribute.name}="${encodeToXmlString(attribute.value)}"`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user