From 91264c7c764f8a1b0d3859c3179fc8ccf18f330f Mon Sep 17 00:00:00 2001 From: Phyo Htet Arkar Date: Fri, 16 Aug 2024 12:55:23 +0700 Subject: [PATCH] fix: remove katex styling import inside mathematics extension --- apps/web/app/layout.tsx | 1 + packages/headless/src/extensions/mathematics.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index cbe30e1c0..aa667dcc4 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -1,5 +1,6 @@ import "@/styles/globals.css"; import "@/styles/prosemirror.css"; +import 'katex/dist/katex.min.css'; import type { Metadata, Viewport } from "next"; import type { ReactNode } from "react"; diff --git a/packages/headless/src/extensions/mathematics.ts b/packages/headless/src/extensions/mathematics.ts index 1f6e5b285..e3d266a1b 100644 --- a/packages/headless/src/extensions/mathematics.ts +++ b/packages/headless/src/extensions/mathematics.ts @@ -1,5 +1,3 @@ -import 'katex/dist/katex.min.css'; - import { Node, mergeAttributes } from "@tiptap/core"; import { EditorState } from "@tiptap/pm/state"; import katex, { type KatexOptions } from "katex"; @@ -42,6 +40,8 @@ declare module "@tiptap/core" { /** * This extension adds support for mathematical symbols with LaTex expression. * + * NOTE: Don't forget to import `katex/dist/katex.min.css` CSS for KaTex styling. + * * @see https://katex.org/ */ export const Mathematics = Node.create({