mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Follow-up of pr #12344
This commit is contained in:
parent
e51e9d1f33
commit
64a6efd95e
9 changed files with 69 additions and 56 deletions
|
@ -13,7 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { parseXFAPath } from "../../src/shared/util.js";
|
||||
import { parseXFAPath } from "../../src/core/core_utils.js";
|
||||
import { SimpleXMLParser } from "../../src/shared/xml_parser.js";
|
||||
|
||||
describe("XML", function () {
|
||||
|
@ -69,7 +69,7 @@ describe("XML", function () {
|
|||
});
|
||||
|
||||
it("should dump a xml tree", function () {
|
||||
let xml = `
|
||||
const xml = `
|
||||
<a>
|
||||
<b>
|
||||
<c a="123"/>
|
||||
|
@ -87,9 +87,7 @@ describe("XML", function () {
|
|||
<h>
|
||||
<i/>
|
||||
<j/>
|
||||
<k>
|
||||
W😂rld
|
||||
<g a="654"/>
|
||||
<k>
W😂rld
<g a="654"/>
|
||||
</k>
|
||||
</h>
|
||||
<b>
|
||||
|
@ -98,13 +96,14 @@ describe("XML", function () {
|
|||
<g a="121110"/>
|
||||
</b>
|
||||
</a>`;
|
||||
xml = xml.replace(/\s+/g, "");
|
||||
const root = new SimpleXMLParser(true).parseFromString(xml)
|
||||
.documentElement;
|
||||
const buffer = [];
|
||||
root.dump(buffer);
|
||||
|
||||
expect(buffer.join("").replace(/\s+/g, "")).toEqual(xml);
|
||||
expect(buffer.join("").replace(/\s+/g, "")).toEqual(
|
||||
xml.replace(/\s+/g, "")
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue