Skip to content
Snippets Groups Projects
PlainNormalizer.ts 379 B
Newer Older
  • Learn to ignore specific revisions
  • import { removeSpacesAndLinebreaks } from "../utils";
    
    export const normalizePlainPart = (text: string): string => {
      text = removeSpacesAndLinebreaks(text);
      return removeQRCodes(text);
    };
    
    const removeQRCodes = (s: string): string => {
      return s
        .replace(/\[qrcode.png]\s*<https:\/\/[\w./?=\-&]+>/g, "")
        .replace(/<https:\/\/[\w./?=\-&]+>\s*\[qrcode.png]/g, "");
    };