Skip to content

Commit

Permalink
Merge pull request #279 from ndaidong/7.0.0
Browse files Browse the repository at this point in the history
v7.0.0rc3
  • Loading branch information
ndaidong authored Jul 11, 2022
2 parents a78e306 + df62e0b commit c6394e6
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions dist/article-parser.browser.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/article-parser.browser.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/cjs/article-parser.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/cjs/article-parser.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "article-parser-cjs",
"version": "7.0.0rc2",
"version": "7.0.0rc3",
"main": "./article-parser.js"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "7.0.0rc2",
"version": "7.0.0rc3",
"name": "article-parser",
"description": "To extract main article from given URL",
"homepage": "https://ndaidong.github.io/article-parser-demo/",
Expand Down Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"@types/sanitize-html": "^2.6.2",
"cross-env": "^7.0.3",
"esbuild": "^0.14.48",
"esbuild": "^0.14.49",
"jest": "^28.1.2",
"nock": "^13.2.8",
"standard": "^17.0.0"
Expand Down
7 changes: 4 additions & 3 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { clone, copies } from 'bellajs'
const requestOptions = {
headers: {
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0',
accept: 'text/html; charset=utf-8'
accept: 'text/html; charset=utf-8',
'accept-encoding': 'deflate,zlib,gzip'
},
responseType: 'text',
responseEncoding: 'utf8',
Expand All @@ -21,10 +22,10 @@ const sanitizeHtmlOptions = {
progress: ['value', 'max'],
img: ['src', 'srcset', 'alt', 'width', 'height', 'style', 'title'],
picture: ['media', 'srcset'],
video: ['controls', 'width', 'height', 'autoplay', 'muted'],
video: ['controls', 'width', 'height', 'autoplay', 'muted', 'loop', 'src'],
audio: ['controls'],
source: ['src', 'srcset', 'data-srcset', 'type', 'media', 'sizes'],
iframe: ['src', 'frameborder', 'height', 'width', 'scrolling'],
iframe: ['src', 'frameborder', 'height', 'width', 'scrolling', 'allow'],
svg: ['width', 'height'] // sanitize-html does not support svg fully yet
},
allowedIframeDomains: ['youtube.com', 'twitter.com', 'facebook.com', 'vimeo.com']
Expand Down
3 changes: 2 additions & 1 deletion src/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ test('Testing setRequestOptions/getRequestOptions methods', () => {
const expectedHeader = {
authorization: 'bearer <token>',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0',
accept: 'text/html; charset=utf-8'
accept: 'text/html; charset=utf-8',
'accept-encoding': 'deflate,zlib,gzip'
}

expect(actual.headers).toEqual(expectedHeader)
Expand Down

0 comments on commit c6394e6

Please sign in to comment.