Skip to content

Commit 9ae0644

Browse files
committed
Reuse existing hljs instance
1 parent 387a740 commit 9ae0644

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Elastic.Documentation.Site/Assets/hljs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,6 @@ export function initHighlight() {
176176
hljs.highlightElement
177177
)
178178
}
179+
180+
// Export the configured hljs instance for reuse
181+
export { hljs }

src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/AskAi/ChatMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { initCopyButton } from '../../../copybutton'
2+
import { hljs } from '../../../hljs'
23
import { GeneratingStatus } from './GeneratingStatus'
34
import { References } from './RelatedResources'
45
import { ChatMessage as ChatMessageType } from './chat.store'
@@ -19,7 +20,6 @@ import {
1920
} from '@elastic/eui'
2021
import { css } from '@emotion/react'
2122
import DOMPurify from 'dompurify'
22-
import hljs from 'highlight.js/lib/core'
2323
import { Marked, RendererObject, Tokens } from 'marked'
2424
import * as React from 'react'
2525
import { useEffect, useMemo } from 'react'

0 commit comments

Comments
 (0)