deepsite / lib /compare-html-diff.ts
enzostvs's picture
enzostvs HF Staff
real html compare
0ee2ef4
raw
history blame contribute delete
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);
};