Comparing version 2.4.2 to 2.4.3
@@ -9,2 +9,6 @@ # Changelog | ||
## [2.4.3] - 2021-04-22 | ||
### Fixed | ||
- Fixed escape logic of PDF names [#252](https://github.com/rkusa/pdfjs/pull/252) | ||
## [2.4.2] - 2020-10-23 | ||
@@ -11,0 +15,0 @@ ### Fixed |
@@ -22,7 +22,2 @@ 'use strict' | ||
// delimiter characters are not allowed | ||
if (name.match(/[\(\)<>\[\]\{\}\/\%]/)) { | ||
throw new Error('A Name mustn\'t contain delimiter characters') | ||
} | ||
name = name.toString() | ||
@@ -41,5 +36,21 @@ | ||
} | ||
return '#' + code | ||
return '#' + Number(code).toString(16) | ||
}) | ||
// Add # in front of delimiter characters | ||
// 25 % | ||
// 28 ( | ||
// 29 ) | ||
// 2f / | ||
// 3c < | ||
// 3e > | ||
// 5b [ | ||
// 5d ] | ||
// 7b { | ||
// 7d } | ||
name = name.replace(/[\x25\x28\x29\x2f\x3c\x3e\x5b\x5d\x7b\x7d]/g, function(c) { | ||
let code = c.charCodeAt(0) | ||
return '#' + Number(code).toString(16) | ||
}) | ||
this.name = name | ||
@@ -46,0 +57,0 @@ } |
@@ -52,3 +52,3 @@ 'use strict' | ||
const inflate = require('pako/lib/inflate').inflate | ||
const inflate = require('pako/lib/inflate.js').inflate | ||
let res = inflate(obj.content.content) | ||
@@ -55,0 +55,0 @@ |
{ | ||
"name": "pdfjs", | ||
"author": "Markus Ast <npm.m@rkusa.st>", | ||
"version": "2.4.2", | ||
"version": "2.4.3", | ||
"description": "A Portable Document Format (PDF) generation library targeting both the server- and client-side.", | ||
@@ -22,3 +22,3 @@ "keywords": [ | ||
"opentype.js": "^1.3.3", | ||
"pako": "^1.0.11", | ||
"pako": "^2.0.3", | ||
"readable-stream": "^3.6.0", | ||
@@ -25,0 +25,0 @@ "unorm": "^1.6.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
341525
6594
+ Addedpako@2.1.0(transitive)
- Removedpako@1.0.11(transitive)
Updatedpako@^2.0.3