Align list of supported tags in rendered markdown (#161544)

This expands the list of html tags we allow in markdown. To get this list, I've copied the list of tags from `markdownDocumentRenderer` into `dom` after  reviewing them

For #134514, I've also added `video` to the list of allowed tags
This commit is contained in:
Matt Bierner
2022-09-22 18:25:48 -07:00
committed by GitHub
parent 93836c720c
commit 2a4fb40a6e
4 changed files with 99 additions and 14 deletions

View File

@@ -8,21 +8,27 @@ import MarkdownIt from 'markdown-it';
import type * as MarkdownItToken from 'markdown-it/lib/token';
import type { ActivationFunction } from 'vscode-notebook-renderer';
const allowedHtmlTags = Object.freeze([
'a',
const allowedHtmlTags = Object.freeze(['a',
'abbr',
'b',
'bdo',
'blockquote',
'br',
'button',
'caption',
'center',
'cite',
'code',
'col',
'colgroup',
'dd',
'del',
'details',
'dfn',
'div',
'dl',
'dt',
'em',
'font',
'figcaption',
'figure',
'h1',
'h2',
'h3',
@@ -32,16 +38,23 @@ const allowedHtmlTags = Object.freeze([
'hr',
'i',
'img',
'input',
'ins',
'kbd',
'label',
'li',
'mark',
'ol',
'p',
'pre',
'select',
'q',
'rp',
'rt',
'ruby',
'samp',
'small',
'small',
'span',
'strike',
'strong',
'sub',
'summary',
@@ -49,15 +62,17 @@ const allowedHtmlTags = Object.freeze([
'table',
'tbody',
'td',
'textarea',
'tfoot',
'th',
'thead',
'time',
'tr',
'tt',
'u',
'ul',
'var',
'video',
'wbr',
]);
const allowedSvgTags = Object.freeze([