1 | From 17d0ec44974857a955a7f2769f4a74e1890f2c35 Mon Sep 17 00:00:00 2001
|
2 | From: rjanicek <rjanicek@connectwise.com>
|
3 | Date: Wed, 20 Apr 2016 11:00:12 -0400
|
4 | Subject: [PATCH] add ignore entities option
|
5 |
|
6 |
|
7 | lib/sax.js | 4 ++++
|
8 | 1 file changed, 4 insertions(+)
|
9 |
|
10 | diff --git a/lib/sax.js b/lib/sax.js
|
11 | index f125c5f..800ffe7 100644
|
12 |
|
13 |
|
14 | @@ -63,6 +63,7 @@
|
15 | parser.strictEntities = parser.opt.strictEntities
|
16 | parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)
|
17 | parser.attribList = []
|
18 | + parser.opt.entities = (typeof parser.opt.entities === 'undefined') ? true : parser.opt.entities;
|
19 |
|
20 | // namespaces form a prototype chain.
|
21 | // it always points at the current tag,
|
22 | @@ -925,6 +926,9 @@
|
23 | }
|
24 |
|
25 | function parseEntity (parser) {
|
26 | + if (!parser.opt.entities) {
|
27 | + return '&' + parser.entity + ';';
|
28 | + }
|
29 | var entity = parser.entity
|
30 | var entityLC = entity.toLowerCase()
|
31 | var num
|
32 | --
|
33 | 2.7.2.windows.1
|
34 |
|