reiji-h 1 год назад
Родитель
Сommit
04d272143e
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      apps/app/src/client/components/ReactMarkdownComponents/Header.tsx

+ 2 - 3
apps/app/src/client/components/ReactMarkdownComponents/Header.tsx

@@ -54,13 +54,12 @@ const EditLink = (props: EditLinkProps): JSX.Element => {
 type HeaderProps = {
 type HeaderProps = {
   children: React.ReactNode,
   children: React.ReactNode,
   node: Element,
   node: Element,
-  level: number,
   id?: string,
   id?: string,
 }
 }
 
 
 export const Header = (props: HeaderProps): JSX.Element => {
 export const Header = (props: HeaderProps): JSX.Element => {
   const {
   const {
-    node, id, children, level,
+    node, id, children,
   } = props;
   } = props;
 
 
   const { data: isGuestUser } = useIsGuestUser();
   const { data: isGuestUser } = useIsGuestUser();
@@ -73,7 +72,7 @@ export const Header = (props: HeaderProps): JSX.Element => {
 
 
   const [isActive, setActive] = useState(false);
   const [isActive, setActive] = useState(false);
 
 
-  const CustomTag = `h${level}` as keyof JSX.IntrinsicElements;
+  const CustomTag = node.tagName as keyof JSX.IntrinsicElements;
 
 
   const activateByHash = useCallback((url: string) => {
   const activateByHash = useCallback((url: string) => {
     try {
     try {