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"
```
This commit is contained in:
Matt Bierner 2022-05-23 15:30:42 -07:00 committed by GitHub
parent a6eb00568f
commit b8420578fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) => {