Skip to content

Commit

Permalink
fix: add target=_parent for all markwdown links
Browse files Browse the repository at this point in the history
  • Loading branch information
rjborba committed Jul 31, 2024
1 parent 928d40c commit bbd6a8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bbd6a8f

Please sign in to comment.