Download lib/compare-html-diff.ts from ERNIE-Community/DeepSite-Using-ERNIE: direct link, hf CLI and curl.
- Browser
- Download file 307 Bytes
-
https://huggingface.co/spaces/ERNIE-Community/DeepSite-Using-ERNIE/resolve/main/lib/compare-html-diff.ts
- Command line
-
hf download hf://spaces/ERNIE-Community/DeepSite-Using-ERNIE/lib/compare-html-diff.ts
-
curl -L -o compare-html-diff.ts https://huggingface.co/spaces/ERNIE-Community/DeepSite-Using-ERNIE/resolve/main/lib/compare-html-diff.ts
307 Bytes
| import { defaultHTML } from "./consts"; | |
| export const isTheSameHtml = (currentHtml: string): boolean => { | |
| const normalize = (html: string): string => | |
| html | |
| .replace(/<!--[\s\S]*?-->/g, "") | |
| .replace(/\s+/g, " ") | |
| .trim(); | |
| return normalize(defaultHTML) === normalize(currentHtml); | |
| }; | |