mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-28 23:28:16 +02:00
XFA - CDATA can be xml so parse it when required
This commit is contained in:
parent
1775d5eeb7
commit
5dc7f4ade8
4 changed files with 52 additions and 0 deletions
|
@ -16,7 +16,9 @@
|
|||
import {
|
||||
$acceptWhitespace,
|
||||
$clean,
|
||||
$content,
|
||||
$finalize,
|
||||
$isCDATAXml,
|
||||
$nsAttributes,
|
||||
$onChild,
|
||||
$onText,
|
||||
|
@ -150,6 +152,13 @@ class XFAParser extends XMLParserBase {
|
|||
|
||||
onEndElement(name) {
|
||||
const node = this._current;
|
||||
if (node[$isCDATAXml]() && typeof node[$content] === "string") {
|
||||
const parser = new XFAParser();
|
||||
const root = parser.parse(node[$content]);
|
||||
node[$content] = null;
|
||||
node[$onChild](root);
|
||||
}
|
||||
|
||||
node[$finalize]();
|
||||
this._current = this._stack.pop();
|
||||
if (this._current[$onChild](node)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue