@mozilla/readability
Advanced tools
Comparing version 0.4.4 to 0.5.0
@@ -14,2 +14,7 @@ # Changelog | ||
## [0.5.0] - 2023-12-15 | ||
- [Add published time metadata](https://github.com/mozilla/readability/pull/813) | ||
- [Expanded comma detection to non-Latin commas](https://github.com/mozilla/readability/pull/796) | ||
- [Fix detection of elements hidden with style="visibility: hidden"](https://github.com/mozilla/readability/pull/817) | ||
## [0.4.4] - 2023-03-31 | ||
@@ -16,0 +21,0 @@ - Fixed [undefined `li_count` variable breaking use of readability in Cloudflare workers](https://github.com/mozilla/readability/issues/791) |
@@ -60,3 +60,6 @@ /** | ||
lang: string; | ||
/** published time */ | ||
publishedTime: string; | ||
}; | ||
} |
{ | ||
"name": "@mozilla/readability", | ||
"version": "0.4.4", | ||
"version": "0.5.0", | ||
"description": "A standalone version of the readability library used for Firefox Reader View.", | ||
@@ -27,3 +27,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@release-it/keep-a-changelog": "3.1.0", | ||
"@release-it/keep-a-changelog": "5.0.0", | ||
"chai": "4.3.7", | ||
@@ -35,5 +35,5 @@ "eslint": "8.27.0", | ||
"mocha": "10.1.0", | ||
"release-it": "15.5.0", | ||
"release-it": "17.0.1", | ||
"sinon": "14.0.2" | ||
} | ||
} |
@@ -37,4 +37,4 @@ # Readability.js | ||
* `keepClasses` (boolean, default `false`): whether to preserve all classes on HTML elements. When set to `false` only classes specified in the `classesToPreserve` array are kept. | ||
* `disableJSONLD` (boolean, default `false`): when extracting page metadata, Readability gives precendence to Schema.org fields specified in the JSON-LD format. Set this option to `true` to skip JSON-LD parsing. | ||
* `serializer` (function, default `el => el.innerHTML`) controls how the the `content` property returned by the `parse()` method is produced from the root DOM element. It may be useful to specify the `serializer` as the identity function (`el => el`) to obtain a DOM element instead of a string for `content` if you plan to process it further. | ||
* `disableJSONLD` (boolean, default `false`): when extracting page metadata, Readability gives precedence to Schema.org fields specified in the JSON-LD format. Set this option to `true` to skip JSON-LD parsing. | ||
* `serializer` (function, default `el => el.innerHTML`) controls how the `content` property returned by the `parse()` method is produced from the root DOM element. It may be useful to specify the `serializer` as the identity function (`el => el`) to obtain a DOM element instead of a string for `content` if you plan to process it further. | ||
* `allowedVideoRegex` (RegExp, default `undefined` ): a regular expression that matches video URLs that should be allowed to be included in the article content. If `undefined`, the [default regex](https://github.com/mozilla/readability/blob/8e8ec27cd2013940bc6f3cc609de10e35a1d9d86/Readability.js#L133) is applied. | ||
@@ -70,6 +70,6 @@ | ||
* `minContentLength` (number, default `140`): the minimum node content length used to decide if the document is readerable; | ||
* `minScore` (number, default `20`): the minumum cumulated 'score' used to determine if the document is readerable; | ||
* `minScore` (number, default `20`): the minimum cumulated 'score' used to determine if the document is readerable; | ||
* `visibilityChecker` (function, default `isNodeVisible`): the function used to determine if a node is visible; | ||
The function returns a boolean corresponding to whether or not we suspect `Readability.parse()` will suceeed at returning an article object. Here's an example: | ||
The function returns a boolean corresponding to whether or not we suspect `Readability.parse()` will succeed at returning an article object. Here's an example: | ||
@@ -100,3 +100,3 @@ ```js | ||
Remember to pass the page's URI as the `url` option in the `JSDOM` constructor (as shown in the example above), so that Readability can convert relative URLs for images, hyperlinks etc. to their absolute counterparts. | ||
Remember to pass the page's URI as the `url` option in the `JSDOM` constructor (as shown in the example above), so that Readability can convert relative URLs for images, hyperlinks, etc. to their absolute counterparts. | ||
@@ -103,0 +103,0 @@ `jsdom` has the ability to run the scripts included in the HTML and fetch remote resources. For security reasons these are [disabled by default](https://github.com/jsdom/jsdom#executing-scripts), and we **strongly** recommend you keep them that way. |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149139
3397