@crawlee/utils 4.0.0-beta.275 → 4.0.0-beta.276

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.
@@ -1,7 +1,7 @@
1
1
  import { tryAbsoluteURL } from './extract-urls.js';
2
2
  // NOTE: We are skipping 'noscript' since it's content is evaluated as text, instead of HTML elements. That damages the results.
3
3
  const SKIP_TAGS_REGEX = /^(script|style|canvas|svg|noscript)$/i;
4
- const BLOCK_TAGS_REGEX = /^(p|h1|h2|h3|h4|h5|h6|ol|ul|li|pre|address|blockquote|dl|div|fieldset|form|table|tr|select|option)$/i;
4
+ const BLOCK_TAGS_REGEX = /^(p|h1|h2|h3|h4|h5|h6|ol|ul|li|pre|address|blockquote|dl|dt|dd|div|fieldset|legend|form|table|caption|tr|select|option|hr|article|aside|section|nav|header|footer|main|hgroup|figure|figcaption|details|summary|dialog|menu)$/i;
5
5
  /**
6
6
  * The function converts a HTML document to a plain text.
7
7
  *
@@ -68,7 +68,7 @@ export async function htmlToText(htmlOrCheerioElement) {
68
68
  else if (elem.tagName === 'br') {
69
69
  push('\n');
70
70
  }
71
- else if (elem.tagName === 'td') {
71
+ else if (elem.tagName === 'td' || elem.tagName === 'th') {
72
72
  process(elem.children, inPre);
73
73
  push('\t');
74
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/utils",
3
- "version": "4.0.0-beta.275",
3
+ "version": "4.0.0-beta.276",
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.4",
46
- "@crawlee/http-client": "4.0.0-beta.275",
47
- "@crawlee/types": "4.0.0-beta.275",
46
+ "@crawlee/http-client": "4.0.0-beta.276",
47
+ "@crawlee/types": "4.0.0-beta.276",
48
48
  "@types/sax": "^1.2.7",
49
49
  "cheerio": "^1.2.0",
50
50
  "domhandler": "^6.0.1",
@@ -63,5 +63,5 @@
63
63
  }
64
64
  }
65
65
  },
66
- "gitHead": "740f25703dfbc1f006c70a22488c816d6858bdce"
66
+ "gitHead": "4332e1245c8d053af16c93d7c180f15c4f022d56"
67
67
  }