Skip to content

Commit 9c0d571

Browse files
authored
Allow 'start' attribute in rendered markdown (microsoft#174854)
Fixes microsoft#174563
1 parent 1a79e7e commit 9c0d571

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/vs/base/browser/dom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ export const basicMarkupHtmlTags = Object.freeze([
14611461

14621462
const defaultDomPurifyConfig = Object.freeze<dompurify.Config & { RETURN_TRUSTED_TYPE: true }>({
14631463
ALLOWED_TAGS: ['a', 'button', 'blockquote', 'code', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'input', 'label', 'li', 'p', 'pre', 'select', 'small', 'span', 'strong', 'textarea', 'ul', 'ol'],
1464-
ALLOWED_ATTR: ['href', 'data-href', 'data-command', 'target', 'title', 'name', 'src', 'alt', 'class', 'id', 'role', 'tabindex', 'style', 'data-code', 'width', 'height', 'align', 'x-dispatch', 'required', 'checked', 'placeholder', 'type'],
1464+
ALLOWED_ATTR: ['href', 'data-href', 'data-command', 'target', 'title', 'name', 'src', 'alt', 'class', 'id', 'role', 'tabindex', 'style', 'data-code', 'width', 'height', 'align', 'x-dispatch', 'required', 'checked', 'placeholder', 'type', 'start'],
14651465
RETURN_DOM: false,
14661466
RETURN_DOM_FRAGMENT: false,
14671467
RETURN_TRUSTED_TYPE: true

src/vs/base/browser/markdownRenderer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ export const allowedMarkdownAttr = [
388388
'target',
389389
'title',
390390
'width',
391+
'start',
391392
];
392393

393394
function getSanitizerOptions(options: { readonly isTrusted?: boolean | MarkdownStringTrustedOptions }): { config: dompurify.Config; allowedSchemes: string[] } {

0 commit comments

Comments
 (0)