diff options
author | Matt Bierner <matb@microsoft.com> | 2022-05-24 01:30:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-24 01:30:42 +0300 |
commit | b8420578fd0acf3c5593503b1f918c683d30304c (patch) | |
tree | f3519101ea053c13ca56088712666a28c9837e2f /extensions | |
parent | a6eb00568fb0ff6e509814108b75da18c27fe366 (diff) |
Add additional allowed tags in untrusted notebook markdown (#150228)
This adds some extra allowed tags when rendering markdown in notebooks. Additions are:
```
"b",
"br",
"caption",
"center",
"col",
"colgroup",
"details",
"em",
"font",
"i",
"kbd",
"sub",
"summary",
"sup",
"table",
"tbody",
"tfoot",
"thead",
"td",
"th",
"tr",
"tt",
"u",
"video"
```
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/markdown-language-features/notebook/index.ts | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/extensions/markdown-language-features/notebook/index.ts b/extensions/markdown-language-features/notebook/index.ts index 079ed928f3f..a036374fed1 100644 --- a/extensions/markdown-language-features/notebook/index.ts +++ b/extensions/markdown-language-features/notebook/index.ts @@ -9,7 +9,57 @@ import type * as MarkdownItToken from 'markdown-it/lib/token'; import type { ActivationFunction } from 'vscode-notebook-renderer'; const sanitizerOptions: DOMPurify.Config = { - ALLOWED_TAGS: ['a', 'button', 'blockquote', 'code', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'img', 'input', 'label', 'li', 'p', 'pre', 'select', 'small', 'span', 'strong', 'textarea', 'ul', 'ol'], + ALLOWED_TAGS: [ + 'a', + 'b', + 'blockquote', + 'br', + 'button', + 'caption', + 'center', + 'code', + 'col', + 'colgroup', + 'details', + 'div', + 'em', + 'font', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'hr', + 'i', + 'img', + 'input', + 'kbd', + 'label', + 'li', + 'ol', + 'p', + 'pre', + 'select', + 'small', + 'span', + 'strong', + 'sub', + 'summary', + 'sup', + 'table', + 'tbody', + 'td', + 'textarea', + 'tfoot', + 'th', + 'thead', + 'tr', + 'tt', + 'u', + 'ul', + 'video', + ], }; export const activate: ActivationFunction<void> = (ctx) => { |