mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
fix 235221: Passing the markdown content to the webview via meta tag and purifying it before use
This commit is contained in:
@@ -98,13 +98,13 @@ export class MdDocumentRenderer {
|
||||
<meta id="vscode-markdown-preview-data"
|
||||
data-settings="${escapeAttribute(JSON.stringify(initialData))}"
|
||||
data-strings="${escapeAttribute(JSON.stringify(previewStrings))}"
|
||||
data-state="${escapeAttribute(JSON.stringify(state || {}))}">
|
||||
data-state="${escapeAttribute(JSON.stringify(state || {}))}"
|
||||
data-md-content="${escapeAttribute(JSON.stringify(body.html))}">
|
||||
<script src="${this._extensionResourcePath(resourceProvider, 'pre.js')}" nonce="${nonce}"></script>
|
||||
${this._getStyles(resourceProvider, sourceUri, config, imageInfo)}
|
||||
<base href="${resourceProvider.asWebviewUri(markdownDocument.uri)}">
|
||||
</head>
|
||||
<body class="vscode-body ${config.scrollBeyondLastLine ? 'scrollBeyondLastLine' : ''} ${config.wordWrap ? 'wordWrap' : ''} ${config.markEditorSelection ? 'showEditorSelection' : ''}">
|
||||
${body.html}
|
||||
${this._getScripts(resourceProvider, nonce)}
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
Reference in New Issue
Block a user