export const setExternalLinksToOpenInNewTab = (
  anchors: NodeListOf<HTMLAnchorElement>
) => {
  const httpRegex = /^https?:\/\//i;
  anchors.forEach((anchor: HTMLAnchorElement) => {
    if (httpRegex.test(anchor.href)) {
      anchor.setAttribute("target", "_blank");
      anchor.setAttribute("rel", "noopener noreferrer");
    }
  });
};
