Spaces:
Sleeping
Sleeping
Download apps/api/src/scraper/scrapeURL/transformers/removeBase64Images.ts from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 433 Bytes
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/scraper/scrapeURL/transformers/removeBase64Images.ts
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/api/src/scraper/scrapeURL/transformers/removeBase64Images.ts
-
curl -L -o removeBase64Images.ts https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/scraper/scrapeURL/transformers/removeBase64Images.ts
433 Bytes
| import { Meta } from ".."; | |
| import { Document } from "../../../controllers/v1/types"; | |
| const regex = /(!\[.*?\])\(data:image\/.*?;base64,.*?\)/g; | |
| export function removeBase64Images(meta: Meta, document: Document): Document { | |
| if (meta.options.removeBase64Images && document.markdown !== undefined) { | |
| document.markdown = document.markdown.replace( | |
| regex, | |
| "$1(<Base64-Image-Removed>)", | |
| ); | |
| } | |
| return document; | |
| } | |