vscode/extensions/markdown-math/notebook/svg-test.ts
Matt Bierner 9d626f12e8
Split MarkdownString out of MarkedString
`MarkedString` is deprecated so it's a little confusing that we still use the type in a few places. Instead split out the non-deprecated `MarkdownString` type
2021-06-16 14:26:18 -07:00

22 lines
769 B
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type { ActivationFunction } from 'vscode-notebook-renderer';
const activate: ActivationFunction = (_ctx) => {
return {
renderOutputItem: (item, element) => {
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.setAttribute('viewBox', '0 0 300 100');
svg.innerHTML = item.text();
element.innerText = '';
element.appendChild(svg);
}
};
};
export { activate };