1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

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

This patch removes unnecessary escape-sequence in (mostly) strings, as a first step, since the ones in regular expressions probably requires more careful testing (just in case).
The only exception is a regular expression in `src/core/annotation.js`, since we should have both unit- and reference-tests for this code *and* given [this information on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Character_Classes#Types):
 > Inside a character set, the dot loses its special meaning and matches a literal dot.

Please find additional details about the ESLint rule at https://eslint.org/docs/rules/no-useless-escape
This commit is contained in:
Jonas Jenwald 2020-10-29 15:40:40 +01:00
parent 7853d9798b
commit 46e94cad17
4 changed files with 6 additions and 6 deletions

View file

@ -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)}"`
);
}
}