未验证 提交 6e08e452 编写于 作者: A Anton Volokha 提交者: GitHub

Fix issue #116591 (#116885)

* Fix Extension README not correctly displaying HTML

* Supports common html attributes

* Remove extra attributes
Co-authored-by: NAnton Volokha <antonvolokha@gmail.com>
上级 bfa04d48
......@@ -69,6 +69,17 @@ import { insane } from 'vs/base/common/insane/insane';
function removeEmbeddedSVGs(documentContent: string): string {
return insane(documentContent, {
allowedTags: [
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h7', 'h8', 'br', 'b', 'i', 'strong', 'em', 'a', 'pre', 'code', 'img', 'tt',
'div', 'ins', 'del', 'sup', 'sub', 'p', 'ol', 'ul', 'table', 'thead', 'tbody', 'tfoot', 'blockquote', 'dl', 'dt',
'dd', 'kbd', 'q', 'samp', 'var', 'hr', 'ruby', 'rt', 'rp', 'li', 'tr', 'td', 'th', 's', 'strike', 'summary', 'details',
'caption', 'figure', 'figcaption', 'abbr', 'bdo', 'cite', 'dfn', 'mark', 'small', 'span', 'time', 'wbr'
],
allowedAttributes: {
'*': [
'align',
]
},
filter(token: { tag: string, attrs: { readonly [key: string]: string } }): boolean {
return token.tag !== 'svg';
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册