@crawlee/utils 4.0.0-beta.227 → 4.0.0-beta.228

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.
@@ -106,16 +106,20 @@ class SitemapXmlParser extends Transform {
106
106
  }
107
107
  }
108
108
  #onText(text) {
109
+ text = text.trim();
110
+ // Whitespace around a CDATA section arrives as separate text events.
111
+ if (text === '') {
112
+ return;
113
+ }
109
114
  if (this.#currentTag === 'loc') {
110
115
  if (this.#rootTagName === 'sitemapindex') {
111
- this.push({ type: 'sitemapUrl', url: text.trim() });
116
+ this.push({ type: 'sitemapUrl', url: text });
112
117
  }
113
118
  if (this.#rootTagName === 'urlset') {
114
119
  this.#url ??= {};
115
- this.#url.loc = text.trim();
120
+ this.#url.loc = text;
116
121
  }
117
122
  }
118
- text = text.trim();
119
123
  if (this.#currentTag === 'lastmod') {
120
124
  const lastmod = new Date(text);
121
125
  if (!Number.isNaN(lastmod.getTime())) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/utils",
3
- "version": "4.0.0-beta.227",
3
+ "version": "4.0.0-beta.228",
4
4
  "description": "A set of shared utilities that can be used by crawlers",
5
5
  "engines": {
6
6
  "node": ">=22.13.0"
@@ -43,8 +43,8 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@apify/validations": "^1.1.0",
46
- "@crawlee/http-client": "4.0.0-beta.227",
47
- "@crawlee/types": "4.0.0-beta.227",
46
+ "@crawlee/http-client": "4.0.0-beta.228",
47
+ "@crawlee/types": "4.0.0-beta.228",
48
48
  "@types/sax": "^1.2.7",
49
49
  "cheerio": "^1.0.0",
50
50
  "domhandler": "^6.0.0",
@@ -63,5 +63,5 @@
63
63
  }
64
64
  }
65
65
  },
66
- "gitHead": "489f64b3e886fd63af7dde5c724e998694239130"
66
+ "gitHead": "896ad32d360ae28019bb7be32f5e97ef480df8db"
67
67
  }