omnidev / lib /compare-html-diff.ts
kalhdrawi's picture
ุฃูˆู„ ุฑูุน ู„ู„ู…ู„ูุงุช ุฅู„ู‰ ุงู„ุณุจูŠุณ kalhdrawi/omnidev
1cf8f01
raw
history blame
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);
};