majro update
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>readability [18 Jan 2025 at 20:19]</title>
|
||||
<title>readability [24 Feb 2025 at 15:42]</title>
|
||||
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxN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LiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
||||
|
||||
<script>
|
||||
@@ -31,7 +31,7 @@
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.chartData = [{"label":"readability.min.js","isAsset":true,"statSize":121815,"parsedSize":49051,"gzipSize":15893,"groups":[{"label":"node_modules","path":"./node_modules","statSize":92482,"groups":[{"label":"@mozilla/readability","path":"./node_modules/@mozilla/readability","statSize":88421,"groups":[{"id":804,"label":"Readability-readerable.js","path":"./node_modules/@mozilla/readability/Readability-readerable.js","statSize":4162},{"id":238,"label":"Readability.js","path":"./node_modules/@mozilla/readability/Readability.js","statSize":84033},{"id":396,"label":"index.js","path":"./node_modules/@mozilla/readability/index.js","statSize":226}],"parsedSize":0,"gzipSize":0},{"label":"remove-markdown","path":"./node_modules/remove-markdown","statSize":4061,"groups":[{"id":481,"label":"index.js","path":"./node_modules/remove-markdown/index.js","statSize":4061}],"parsedSize":0,"gzipSize":0}],"parsedSize":0,"gzipSize":0},{"label":"src","path":"./src","statSize":29333,"groups":[{"id":922,"label":"index.js + 1 modules (concatenated)","path":"./src/index.js + 1 modules (concatenated)","statSize":29333,"parsedSize":49043,"gzipSize":15893,"concatenated":true,"groups":[{"label":"src","path":"./src/index.js + 1 modules (concatenated)/src","statSize":4271,"groups":[{"id":null,"label":"index.js","path":"./src/index.js + 1 modules (concatenated)/src/index.js","statSize":4271,"parsedSize":7140,"gzipSize":2314,"inaccurateSizes":true}],"parsedSize":7140,"gzipSize":2314,"inaccurateSizes":true},{"label":"node_modules/turndown/lib","path":"./src/index.js + 1 modules (concatenated)/node_modules/turndown/lib","statSize":25062,"groups":[{"id":null,"label":"turndown.browser.es.js","path":"./src/index.js + 1 modules (concatenated)/node_modules/turndown/lib/turndown.browser.es.js","statSize":25062,"parsedSize":41902,"gzipSize":13578,"inaccurateSizes":true}],"parsedSize":41902,"gzipSize":13578,"inaccurateSizes":true}]}],"parsedSize":49043,"gzipSize":15893}],"isInitialByEntrypoint":{"main":true}}];
|
||||
window.chartData = [{"label":"readability.min.js","isAsset":true,"statSize":121880,"parsedSize":49105,"gzipSize":15912,"groups":[{"label":"node_modules","path":"./node_modules","statSize":92482,"groups":[{"label":"@mozilla/readability","path":"./node_modules/@mozilla/readability","statSize":88421,"groups":[{"id":804,"label":"Readability-readerable.js","path":"./node_modules/@mozilla/readability/Readability-readerable.js","statSize":4162},{"id":238,"label":"Readability.js","path":"./node_modules/@mozilla/readability/Readability.js","statSize":84033},{"id":396,"label":"index.js","path":"./node_modules/@mozilla/readability/index.js","statSize":226}],"parsedSize":0,"gzipSize":0},{"label":"remove-markdown","path":"./node_modules/remove-markdown","statSize":4061,"groups":[{"id":481,"label":"index.js","path":"./node_modules/remove-markdown/index.js","statSize":4061}],"parsedSize":0,"gzipSize":0}],"parsedSize":0,"gzipSize":0},{"label":"src","path":"./src","statSize":29398,"groups":[{"id":922,"label":"index.js + 1 modules (concatenated)","path":"./src/index.js + 1 modules (concatenated)","statSize":29398,"parsedSize":49097,"gzipSize":15912,"concatenated":true,"groups":[{"label":"src","path":"./src/index.js + 1 modules (concatenated)/src","statSize":4336,"groups":[{"id":null,"label":"index.js","path":"./src/index.js + 1 modules (concatenated)/src/index.js","statSize":4336,"parsedSize":7241,"gzipSize":2346,"inaccurateSizes":true}],"parsedSize":7241,"gzipSize":2346,"inaccurateSizes":true},{"label":"node_modules/turndown/lib","path":"./src/index.js + 1 modules (concatenated)/node_modules/turndown/lib","statSize":25062,"groups":[{"id":null,"label":"turndown.browser.es.js","path":"./src/index.js + 1 modules (concatenated)/node_modules/turndown/lib/turndown.browser.es.js","statSize":25062,"parsedSize":41855,"gzipSize":13565,"inaccurateSizes":true}],"parsedSize":41855,"gzipSize":13565,"inaccurateSizes":true}]}],"parsedSize":49097,"gzipSize":15912}],"isInitialByEntrypoint":{"main":true}}];
|
||||
window.entrypoints = ["main"];
|
||||
window.defaultSizes = "parsed";
|
||||
</script>
|
||||
|
||||
+24
-20
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"hash": "68fe8281f85d9e1fa8f9",
|
||||
"hash": "3b7b601a842a4a70dcf0",
|
||||
"version": "5.97.1",
|
||||
"time": 560,
|
||||
"builtAt": 1737227987116,
|
||||
"time": 695,
|
||||
"builtAt": 1740408169935,
|
||||
"publicPath": "auto",
|
||||
"outputPath": "/home/fafre/development/repos/lensai/packages/flutter_mozilla_components/javascript/readability/dist",
|
||||
"assetsByChunkName": {
|
||||
@@ -14,14 +14,14 @@
|
||||
{
|
||||
"type": "asset",
|
||||
"name": "readability.min.js",
|
||||
"size": 49051,
|
||||
"size": 49105,
|
||||
"emitted": true,
|
||||
"comparedForEmit": false,
|
||||
"cached": false,
|
||||
"info": {
|
||||
"javascriptModule": false,
|
||||
"minimized": true,
|
||||
"size": 49051
|
||||
"size": 49105
|
||||
},
|
||||
"chunkNames": [
|
||||
"main"
|
||||
@@ -43,9 +43,9 @@
|
||||
"initial": true,
|
||||
"entry": true,
|
||||
"recorded": false,
|
||||
"size": 122485,
|
||||
"size": 122550,
|
||||
"sizes": {
|
||||
"javascript": 121815,
|
||||
"javascript": 121880,
|
||||
"runtime": 670
|
||||
},
|
||||
"names": [
|
||||
@@ -59,7 +59,7 @@
|
||||
"readability.min.js"
|
||||
],
|
||||
"auxiliaryFiles": [],
|
||||
"hash": "bf73e1848f9bdc88f1b3",
|
||||
"hash": "560dd27471dfc45dd435",
|
||||
"childrenByOrder": {},
|
||||
"id": 792,
|
||||
"siblings": [],
|
||||
@@ -428,9 +428,9 @@
|
||||
"type": "module",
|
||||
"moduleType": "javascript/esm",
|
||||
"layer": null,
|
||||
"size": 29333,
|
||||
"size": 29398,
|
||||
"sizes": {
|
||||
"javascript": 29333
|
||||
"javascript": 29398
|
||||
},
|
||||
"built": true,
|
||||
"codeGenerated": true,
|
||||
@@ -486,6 +486,7 @@
|
||||
],
|
||||
"usedExports": true,
|
||||
"providedExports": [
|
||||
"parseFullMarkdown",
|
||||
"parseReaderable"
|
||||
],
|
||||
"optimizationBailout": [
|
||||
@@ -497,9 +498,9 @@
|
||||
"type": "module",
|
||||
"moduleType": "javascript/auto",
|
||||
"layer": null,
|
||||
"size": 4271,
|
||||
"size": 4336,
|
||||
"sizes": {
|
||||
"javascript": 4271
|
||||
"javascript": 4336
|
||||
},
|
||||
"built": true,
|
||||
"codeGenerated": false,
|
||||
@@ -529,6 +530,7 @@
|
||||
"reasons": [],
|
||||
"usedExports": true,
|
||||
"providedExports": [
|
||||
"parseFullMarkdown",
|
||||
"parseReaderable"
|
||||
],
|
||||
"optimizationBailout": [
|
||||
@@ -743,9 +745,9 @@
|
||||
"type": "module",
|
||||
"moduleType": "javascript/esm",
|
||||
"layer": null,
|
||||
"size": 29333,
|
||||
"size": 29398,
|
||||
"sizes": {
|
||||
"javascript": 29333
|
||||
"javascript": 29398
|
||||
},
|
||||
"built": true,
|
||||
"codeGenerated": true,
|
||||
@@ -800,6 +802,7 @@
|
||||
],
|
||||
"usedExports": true,
|
||||
"providedExports": [
|
||||
"parseFullMarkdown",
|
||||
"parseReaderable"
|
||||
],
|
||||
"optimizationBailout": [
|
||||
@@ -811,9 +814,9 @@
|
||||
"type": "module",
|
||||
"moduleType": "javascript/auto",
|
||||
"layer": null,
|
||||
"size": 4271,
|
||||
"size": 4336,
|
||||
"sizes": {
|
||||
"javascript": 4271
|
||||
"javascript": 4336
|
||||
},
|
||||
"built": true,
|
||||
"codeGenerated": false,
|
||||
@@ -842,6 +845,7 @@
|
||||
"reasons": [],
|
||||
"usedExports": true,
|
||||
"providedExports": [
|
||||
"parseFullMarkdown",
|
||||
"parseReaderable"
|
||||
],
|
||||
"optimizationBailout": [
|
||||
@@ -1478,11 +1482,11 @@
|
||||
"assets": [
|
||||
{
|
||||
"name": "readability.min.js",
|
||||
"size": 49051
|
||||
"size": 49105
|
||||
}
|
||||
],
|
||||
"filteredAssets": 0,
|
||||
"assetsSize": 49051,
|
||||
"assetsSize": 49105,
|
||||
"auxiliaryAssets": [],
|
||||
"filteredAuxiliaryAssets": 0,
|
||||
"auxiliaryAssetsSize": 0,
|
||||
@@ -1500,11 +1504,11 @@
|
||||
"assets": [
|
||||
{
|
||||
"name": "readability.min.js",
|
||||
"size": 49051
|
||||
"size": 49105
|
||||
}
|
||||
],
|
||||
"filteredAssets": 0,
|
||||
"assetsSize": 49051,
|
||||
"assetsSize": 49105,
|
||||
"auxiliaryAssets": [],
|
||||
"filteredAuxiliaryAssets": 0,
|
||||
"auxiliaryAssetsSize": 0,
|
||||
|
||||
@@ -6,106 +6,106 @@ const removeMarkdown = require('remove-markdown');
|
||||
const turndownService = new TurndownService();
|
||||
|
||||
function sanitizeHtmlTags(node, unwantedSelectors) {
|
||||
unwantedSelectors.forEach(selector => {
|
||||
node.querySelectorAll(selector).forEach(el => el.remove());
|
||||
});
|
||||
unwantedSelectors.forEach(selector => {
|
||||
node.querySelectorAll(selector).forEach(el => el.remove());
|
||||
});
|
||||
|
||||
return node;
|
||||
return node;
|
||||
}
|
||||
|
||||
function parseFullMarkdown(node) {
|
||||
const clonedDoc = node.cloneNode(true);
|
||||
const clonedDoc = node.cloneNode(true);
|
||||
|
||||
sanitizeHtmlTags(clonedDoc, [
|
||||
/* Navigation and Header Elements */
|
||||
'nav',
|
||||
'footer',
|
||||
'header',
|
||||
'aside',
|
||||
'menu',
|
||||
'toolbar',
|
||||
sanitizeHtmlTags(clonedDoc, [
|
||||
/* Navigation and Header Elements */
|
||||
'nav',
|
||||
'footer',
|
||||
'header',
|
||||
'aside',
|
||||
'menu',
|
||||
'toolbar',
|
||||
|
||||
/* Interactive Elements */
|
||||
'form',
|
||||
'button',
|
||||
'[role="button"]',
|
||||
'[type="button"]',
|
||||
'dialog',
|
||||
'modal',
|
||||
/* Interactive Elements */
|
||||
'form',
|
||||
'button',
|
||||
'[role="button"]',
|
||||
'[type="button"]',
|
||||
'dialog',
|
||||
'modal',
|
||||
|
||||
/* Hidden Elements */
|
||||
'[aria-hidden="true"]',
|
||||
'[hidden]',
|
||||
'[style*="display: none"]',
|
||||
'[style*="visibility: hidden"]',
|
||||
'.hidden',
|
||||
'.invisible',
|
||||
/* Hidden Elements */
|
||||
'[aria-hidden="true"]',
|
||||
'[hidden]',
|
||||
'[style*="display: none"]',
|
||||
'[style*="visibility: hidden"]',
|
||||
'.hidden',
|
||||
'.invisible',
|
||||
|
||||
/* Advertising and Marketing */
|
||||
'.ad',
|
||||
'.advertisement',
|
||||
'.banner',
|
||||
'.sponsored',
|
||||
'.promotion',
|
||||
'.popup',
|
||||
'.newsletter',
|
||||
'.subscribe',
|
||||
/* Advertising and Marketing */
|
||||
'.ad',
|
||||
'.advertisement',
|
||||
'.banner',
|
||||
'.sponsored',
|
||||
'.promotion',
|
||||
'.popup',
|
||||
'.newsletter',
|
||||
'.subscribe',
|
||||
|
||||
/* Social Media */
|
||||
'.social-share',
|
||||
'.social-media',
|
||||
'.share-buttons',
|
||||
'.follow-us',
|
||||
'.likes',
|
||||
'.comments',
|
||||
/* Social Media */
|
||||
'.social-share',
|
||||
'.social-media',
|
||||
'.share-buttons',
|
||||
'.follow-us',
|
||||
'.likes',
|
||||
'.comments',
|
||||
|
||||
/* Common UI Components */
|
||||
'.cookie-notice',
|
||||
'.cookie-banner',
|
||||
'.modal',
|
||||
'.overlay',
|
||||
'.tooltip',
|
||||
'.popup',
|
||||
'.sidebar',
|
||||
'.widget',
|
||||
/* Common UI Components */
|
||||
'.cookie-notice',
|
||||
'.cookie-banner',
|
||||
'.modal',
|
||||
'.overlay',
|
||||
'.tooltip',
|
||||
'.popup',
|
||||
'.sidebar',
|
||||
'.widget',
|
||||
|
||||
/* Navigation Related */
|
||||
'.breadcrumb',
|
||||
'.pagination',
|
||||
'.menu',
|
||||
'.navbar',
|
||||
'.navigation',
|
||||
/* Navigation Related */
|
||||
'.breadcrumb',
|
||||
'.pagination',
|
||||
'.menu',
|
||||
'.navbar',
|
||||
'.navigation',
|
||||
|
||||
/* Related Content */
|
||||
'.related-posts',
|
||||
'.recommended',
|
||||
'.suggestions',
|
||||
'.read-more',
|
||||
/* Related Content */
|
||||
'.related-posts',
|
||||
'.recommended',
|
||||
'.suggestions',
|
||||
'.read-more',
|
||||
|
||||
/* Interactive Features */
|
||||
'.search',
|
||||
'.search-box',
|
||||
'.login',
|
||||
'.signup',
|
||||
'.register',
|
||||
/* Interactive Features */
|
||||
'.search',
|
||||
'.search-box',
|
||||
'.login',
|
||||
'.signup',
|
||||
'.register',
|
||||
|
||||
/* Print-specific */
|
||||
'.print-only',
|
||||
'[media="print"]'
|
||||
]);
|
||||
/* Print-specific */
|
||||
'.print-only',
|
||||
'[media="print"]'
|
||||
]);
|
||||
|
||||
const fullMarkdown = turndownService.turndown(clonedDoc.body.innerHTML);
|
||||
const fullMarkdown = turndownService.turndown(clonedDoc.body.innerHTML);
|
||||
|
||||
let response = {
|
||||
fullContentMarkdown: fullMarkdown,
|
||||
fullContentPlain: removeMarkdown(fullMarkdown),
|
||||
};
|
||||
let response = {
|
||||
fullContentMarkdown: fullMarkdown,
|
||||
fullContentPlain: removeMarkdown(fullMarkdown),
|
||||
};
|
||||
|
||||
return response;
|
||||
return response;
|
||||
}
|
||||
|
||||
function parseReaderable(document, options) {
|
||||
const clonedDoc = document.cloneNode(true);
|
||||
const clonedDoc = document.cloneNode(true);
|
||||
sanitizeHtmlTags(clonedDoc, [
|
||||
/* Technical Elements */
|
||||
'script',
|
||||
@@ -143,4 +143,6 @@ function parseReaderable(document, options) {
|
||||
}
|
||||
|
||||
window.parseReaderable = parseReaderable;
|
||||
export { parseReaderable };
|
||||
window.parseFullMarkdown = parseFullMarkdown;
|
||||
|
||||
export { parseReaderable, parseFullMarkdown };
|
||||
Reference in New Issue
Block a user