Public
Script
October 23, 2023
1
2
3
4
5
6
7
8
9
export const simplifyHTML = async (params) => {
const { DOMParser } = await import(
"https://deno.land/x/deno_dom/deno-dom-wasm.ts"
);
const { Readability } = await import("npm:@mozilla/readability");
const doc = new DOMParser().parseFromString(params.html, "text/html");
const reader = new Readability(doc);
return reader.parse();
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023