소스 검색

update is highlighted by elasticsearch

ryoji-s 3 년 전
부모
커밋
27a47db638
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      packages/app/src/components/ReactMarkdownComponents/CodeBlock.tsx

+ 2 - 1
packages/app/src/components/ReactMarkdownComponents/CodeBlock.tsx

@@ -9,7 +9,8 @@ import styles from './CodeBlock.module.scss';
 export const CodeBlock: CodeComponent = ({ inline, className, children }) => {
 
   const isHighlightedByElasticsearch = useMemo((): boolean => {
-    return !(children.every(item => typeof item === 'string') && children.length === 1);
+    const hasOnlyOneStringChild = children.length === 1 && typeof children[0] === 'string';
+    return !hasOnlyOneStringChild;
   }, [children]);
 
   if (inline) {