exifreader 4.51.0 → 4.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/xmp-tags.js CHANGED
@@ -139,9 +139,9 @@ function readTags(tags, chunkDataView, domParser) {
139
139
  }
140
140
 
141
141
  function getDocument(chunkDataView, _domParser) {
142
- const domParser = DOMParser.get(_domParser);
142
+ const {parser: domParser, warning} = DOMParser.get(_domParser);
143
143
  if (!domParser) {
144
- console.warn('Warning: DOMParser is not available. It is needed to be able to parse XMP tags.'); // eslint-disable-line no-console
144
+ console.warn(warning); // eslint-disable-line no-console
145
145
  throw new Error();
146
146
  }
147
147
 
@@ -219,7 +219,7 @@ function trimAfterPacketTrailer(xmlSource) {
219
219
 
220
220
  function parseFromString(domParser, xmlString, isRetry = false) {
221
221
  if (exceedsMarkupBounds(xmlString, MAX_ELEMENT_DEPTH, MAX_MARKUP_NODES)) {
222
- throw new ParseError(`XMP elements nested deeper than ${MAX_ELEMENT_DEPTH} levels or more than ${MAX_MARKUP_NODES} markup nodes.`);
222
+ throw new ParseError(`XMP has elements nested deeper than ${MAX_ELEMENT_DEPTH} levels, more than ${MAX_MARKUP_NODES} markup nodes, or a markup declaration.`);
223
223
  }
224
224
  try {
225
225
  const doc = domParser.parseFromString(xmlString, 'application/xml');