Merge branch 'main' into move-fixtures

move-fixtures
Sarah Doire 2 years ago committed by GitHub
commit 1594aea038
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,12 @@
# Mercury Parser Changelog
### 2.2.3 (Oct 24, 2022)
- [[`635fcf6356`](https://github.com/postlight/parser/commit/635fcf6356)] - **fix**: handle sec & ms timestamps properly (#702) (Austin)
- [[`ab401822aa`](https://github.com/postlight/parser/commit/ab401822aa)] - maintenance update - october 2022 (#696) (Michael Ashley)
- [[`8ca8a5f7e5`](https://github.com/postlight/parser/commit/8ca8a5f7e5)] - **feat**: add postlight.com custom extractor (#695) (Sarah Doire)
- [[`39b9ff55c4`](https://github.com/postlight/parser/commit/39b9ff55c4)] - **release**: 2.2.2 (#689) (John Holdun)
### 2.2.2 (Sept 08, 2022)
##### Commits

6
dist/mercury.js vendored

@ -6329,10 +6329,14 @@ function cleanDatePublished(dateString) {
format = _ref.format;
// If string is in milliseconds or seconds, convert to int and return
if (MS_DATE_STRING.test(dateString) || SEC_DATE_STRING.test(dateString)) {
if (MS_DATE_STRING.test(dateString)) {
return new Date(_parseInt(dateString, 10)).toISOString();
}
if (SEC_DATE_STRING.test(dateString)) {
return new Date(_parseInt(dateString, 10) * 1000).toISOString();
}
var date = createDate(dateString, timezone, format);
if (!date.isValid()) {

File diff suppressed because one or more lines are too long

@ -1,6 +1,6 @@
{
"name": "@postlight/parser",
"version": "2.2.2",
"version": "2.2.3",
"description": "Postlight Parser transforms web pages into clean text. Publishers and programmers use it to make the web make sense, and readers use it to read any web article comfortably.",
"author": "Postlight <mercury@postlight.com>",
"homepage": "https://reader.postlight.com",

@ -51,9 +51,12 @@ export default function cleanDatePublished(
{ timezone, format } = {}
) {
// If string is in milliseconds or seconds, convert to int and return
if (MS_DATE_STRING.test(dateString) || SEC_DATE_STRING.test(dateString)) {
if (MS_DATE_STRING.test(dateString)) {
return new Date(parseInt(dateString, 10)).toISOString();
}
if (SEC_DATE_STRING.test(dateString)) {
return new Date(parseInt(dateString, 10) * 1000).toISOString();
}
let date = createDate(dateString, timezone, format);

Loading…
Cancel
Save