diff --git a/src/components/EditorContent/index.jsx b/src/components/EditorContent/index.jsx index 7f1dec46..3b1b9c92 100644 --- a/src/components/EditorContent/index.jsx +++ b/src/components/EditorContent/index.jsx @@ -3,7 +3,7 @@ import React, { useEffect, useRef, useState } from "react"; import classnames from "classnames"; import DOMPurify from "dompurify"; import CopyToClipboardButton from "neetomolecules/CopyToClipboardButton"; -import { isNil, not } from "ramda"; +import { not } from "ramda"; import { createRoot } from "react-dom/client"; import { EDITOR_CONTENT_CLASSNAME, SANITIZE_OPTIONS } from "./constants"; @@ -45,9 +45,10 @@ const EditorContent = ({ figureTags.forEach(figureTag => { const image = figureTag.querySelector("img"); const link = figureTag.querySelector("a"); - if (isNil(image) || isNil(link)) return; - - if (not(window.getComputedStyle(link).pointerEvents === "none")) { + if ( + !image || + not(window.getComputedStyle(link).pointerEvents === "none") + ) { return; } figureTag.style.cursor = "pointer";