1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-21 23:58:07 +02:00

Dict keys need to be escaped too when saving

This commit is contained in:
Calixte Denizet 2020-09-11 12:25:05 +02:00
parent aef3fedc29
commit fc154590e8
2 changed files with 3 additions and 3 deletions

View file

@ -98,14 +98,14 @@ describe("Writer", function () {
it("should write a Dict in escaping PDF names", function (done) {
const dict = new Dict(null);
dict.set("A", Name.get("hello"));
dict.set("\xfeA#", Name.get("hello"));
dict.set("B", Name.get("#hello"));
dict.set("C", Name.get("he\xfello\xff"));
const buffer = [];
writeDict(dict, buffer, null);
const expected = "<< /A /hello /B /#23hello /C /he#fello#ff>>";
const expected = "<< /#feA#23 /hello /B /#23hello /C /he#fello#ff>>";
expect(buffer.join("")).toEqual(expected);
done();