fix(plugins): html2text format
This commit is contained in:
parent
41dab54df3
commit
1d47c66f7d
@ -19,10 +19,12 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
"linkedom": "^0.18.0",
|
||||
"@txtdot/sdk": "workspace:*"
|
||||
"@txtdot/sdk": "workspace:*",
|
||||
"html-to-text": "^9.0.5",
|
||||
"linkedom": "^0.18.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/html-to-text": "^9.0.4",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
||||
|
@ -7,3 +7,9 @@ export const engineList = [
|
||||
engines.SearX,
|
||||
engines.Readability,
|
||||
];
|
||||
|
||||
import { compile } from 'html-to-text';
|
||||
|
||||
export const html2text = compile({
|
||||
selectors: [{ selector: 'img', format: 'skip' }],
|
||||
});
|
||||
|
@ -30,7 +30,6 @@
|
||||
"dotenv": "^16.3.1",
|
||||
"ejs": "^3.1.10",
|
||||
"fastify": "^4.26.2",
|
||||
"html-to-text": "^9.0.5",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"ip-range-check": "^0.2.0",
|
||||
"json-schema-to-ts": "^3.0.1",
|
||||
@ -41,7 +40,6 @@
|
||||
"devDependencies": {
|
||||
"@types/dompurify": "^3.0.5",
|
||||
"@types/ejs": "^3.1.5",
|
||||
"@types/html-to-text": "^9.0.4",
|
||||
"@types/jsdom": "^21.1.6",
|
||||
"@types/micromatch": "^4.0.7",
|
||||
"clean-css-cli": "^5.6.3",
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { IAppConfig } from '../types/pluginConfig';
|
||||
import { engineList } from '@txtdot/plugins';
|
||||
import { compile } from 'html-to-text';
|
||||
import { engineList, html2text } from '@txtdot/plugins';
|
||||
|
||||
/**
|
||||
* Configuration of plugins
|
||||
@ -8,7 +7,7 @@ import { compile } from 'html-to-text';
|
||||
*/
|
||||
const plugin_config: IAppConfig = {
|
||||
engines: [...engineList],
|
||||
html2text: compile(),
|
||||
html2text,
|
||||
};
|
||||
|
||||
export default plugin_config;
|
||||
|
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@ -41,10 +41,16 @@ importers:
|
||||
'@txtdot/sdk':
|
||||
specifier: workspace:*
|
||||
version: link:../sdk
|
||||
html-to-text:
|
||||
specifier: ^9.0.5
|
||||
version: 9.0.5
|
||||
linkedom:
|
||||
specifier: ^0.18.0
|
||||
version: 0.18.0
|
||||
devDependencies:
|
||||
'@types/html-to-text':
|
||||
specifier: ^9.0.4
|
||||
version: 9.0.4
|
||||
typescript:
|
||||
specifier: ^5.4.5
|
||||
version: 5.4.5
|
||||
@ -103,9 +109,6 @@ importers:
|
||||
fastify:
|
||||
specifier: ^4.26.2
|
||||
version: 4.27.0
|
||||
html-to-text:
|
||||
specifier: ^9.0.5
|
||||
version: 9.0.5
|
||||
iconv-lite:
|
||||
specifier: ^0.6.3
|
||||
version: 0.6.3
|
||||
@ -131,9 +134,6 @@ importers:
|
||||
'@types/ejs':
|
||||
specifier: ^3.1.5
|
||||
version: 3.1.5
|
||||
'@types/html-to-text':
|
||||
specifier: ^9.0.4
|
||||
version: 9.0.4
|
||||
'@types/jsdom':
|
||||
specifier: ^21.1.6
|
||||
version: 21.1.6
|
||||
|
Loading…
x
Reference in New Issue
Block a user