Spaces:
Paused
Paused
Download lib/compare-html-diff.ts from kalhdrawi/omnidev: direct link, hf CLI and curl.
- Browser
- Download file 307 Bytes
-
https://huggingface.co/spaces/kalhdrawi/omnidev/resolve/b0e750c9e673e51ffb0e95d19efd8e2b8076fedb/lib/compare-html-diff.ts
- Command line
-
hf download hf://spaces/kalhdrawi/omnidev@b0e750c9e673e51ffb0e95d19efd8e2b8076fedb/lib/compare-html-diff.ts
-
curl -L -o compare-html-diff.ts https://huggingface.co/spaces/kalhdrawi/omnidev/resolve/b0e750c9e673e51ffb0e95d19efd8e2b8076fedb/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); | |
| }; | |