Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix *some* errors reported by the ESLint no-useless-escape rule #12551

Merged
merged 1 commit into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ class WidgetAnnotation extends Annotation {
// 1.5 * capHeight * fontSize seems to be a good value for lineHeight
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) {
// The font size is missing
fontRegex = new RegExp(`/${fontName}\\s+Tf`);
Expand Down
4 changes: 2 additions & 2 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3415,8 +3415,8 @@ class PartialEvaluator {
var baseFontStr = baseFont && baseFont.name;
if (fontNameStr !== baseFontStr) {
info(
`The FontDescriptor\'s FontName is "${fontNameStr}" but ` +
`should be the same as the Font\'s BaseFont "${baseFontStr}".`
`The FontDescriptor's FontName is "${fontNameStr}" but ` +
`should be the same as the Font's BaseFont "${baseFontStr}".`
);
// Workaround for cases where e.g. fontNameStr = 'Arial' and
// baseFontStr = 'Arial,Bold' (needed when no font file is embedded).
Expand Down
4 changes: 2 additions & 2 deletions src/scripting_api/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ class Field extends PDFObject {
} catch (error) {
event.rc = false;
const value =
`\"${error.toString()}\" for event ` +
`\"${eventName}\" in object ${this._id}.` +
`"${error.toString()}" for event ` +
`"${eventName}" in object ${this._id}.` +
`\n${error.stack}`;
this._send({ command: "error", value });
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/xml_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class SimpleDOMNode {
if (this.attributes) {
for (const attribute of this.attributes) {
buffer.push(
` ${attribute.name}=\"${encodeToXmlString(attribute.value)}\"`
` ${attribute.name}="${encodeToXmlString(attribute.value)}"`
);
}
}
Expand Down