* Add Entity which is not by default supported by this library * @param {string} key * @param {string} value
(key, value)
| 44 | * @param {string} value |
| 45 | */ |
| 46 | addEntity(key, value) { |
| 47 | if (value.indexOf("&") !== -1) { |
| 48 | throw new Error("Entity value can't have '&'") |
| 49 | } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { |
| 50 | throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'") |
| 51 | } else if (value === "&") { |
| 52 | throw new Error("An entity with value '&' is not permitted"); |
| 53 | } else { |
| 54 | this.externalEntities[key] = value; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Returns a Symbol that can be used to access the metadata |
nothing calls this directly
no outgoing calls
no test coverage detected