Spaces:
Paused
Paused
Download src/scraper/scrapeURL/transformers/removeBase64Images.ts from Echo-AI-official/Fire-crawl: direct link, hf CLI and curl.
- Browser
- Download file 433 Bytes
-
https://huggingface.co/spaces/Echo-AI-official/Fire-crawl/resolve/main/src/scraper/scrapeURL/transformers/removeBase64Images.ts
- Command line
-
hf download hf://spaces/Echo-AI-official/Fire-crawl/src/scraper/scrapeURL/transformers/removeBase64Images.ts
-
curl -L -o removeBase64Images.ts https://huggingface.co/spaces/Echo-AI-official/Fire-crawl/resolve/main/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; | |
| } | |