diff --git a/packages/ui-stencil/src/components/internal/orama-chat-messages-container/orama-chat-assistent-message/orama-markdown/orama-markdown.tsx b/packages/ui-stencil/src/components/internal/orama-chat-messages-container/orama-chat-assistent-message/orama-markdown/orama-markdown.tsx index 93719ac5..6258c8a3 100644 --- a/packages/ui-stencil/src/components/internal/orama-chat-messages-container/orama-chat-assistent-message/orama-markdown/orama-markdown.tsx +++ b/packages/ui-stencil/src/components/internal/orama-chat-messages-container/orama-chat-assistent-message/orama-markdown/orama-markdown.tsx @@ -6,6 +6,13 @@ import { marked } from 'marked' // biome-ignore lint/suspicious/noExplicitAny: Let me be, TypeScript ;(window as any).hljs = hljs +DOMPurify.addHook('afterSanitizeAttributes', (node) => { + if ('href' in node) { + node.setAttribute('target', '_parent') + node.setAttribute('rel', 'noopener') + } +}) + /** * In order to keep the bundle size small, we are loading the languages grammars by fecthing hljs's CDN dynamically. * This file is used as a in-memory static global variable to store the languages grammars references and fetching states. diff --git a/packages/ui-stencil/src/components/internal/orama-chat/readme.md b/packages/ui-stencil/src/components/internal/orama-chat/readme.md index df6495b3..5cb696c5 100644 --- a/packages/ui-stencil/src/components/internal/orama-chat/readme.md +++ b/packages/ui-stencil/src/components/internal/orama-chat/readme.md @@ -12,7 +12,7 @@ | `placeholder` | `placeholder` | | `string` | `'Ask me anything'` | | `showClearChat` | `show-clear-chat` | | `boolean` | `true` | | `sourceBaseUrl` | `source-base-url` | | `string` | `''` | -| `sourcesMap` | -- | | `{ title?: string; description?: string; path?: string; }` | `undefined` | +| `sourcesMap` | -- | | `{ title?: string; path?: string; description?: string; }` | `undefined` | ## Dependencies