mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Refine CellInfo type (#125351)
For #125269 - Rename `CellInfo` - >`OutputItem` (only internally, we also need to update the published types) - Move `id` into `OutputItem` - Move `element` out of `OutputItem` - Rename `renderCell` to `renderOutputItem` - Rename `destoryCell` to `disposeOutputItem` (`dispose` is the term we generally use in our APIs)
This commit is contained in:
@@ -11,13 +11,13 @@ export function activate() {
|
||||
});
|
||||
|
||||
return {
|
||||
renderCell: (_id: string, context: { element: HTMLElement, value: string, text(): string }) => {
|
||||
const rendered = markdownIt.render(context.text());
|
||||
context.element.innerHTML = rendered;
|
||||
renderOutputItem: (outputInfo: { text(): string }, element: HTMLElement) => {
|
||||
const rendered = markdownIt.render(outputInfo.text());
|
||||
element.innerHTML = rendered;
|
||||
|
||||
// Insert styles into markdown preview shadow dom so that they are applied
|
||||
for (const markdownStyleNode of document.getElementsByClassName('markdown-style')) {
|
||||
context.element.insertAdjacentElement('beforebegin', markdownStyleNode.cloneNode(true) as Element);
|
||||
element.insertAdjacentElement('beforebegin', markdownStyleNode.cloneNode(true) as Element);
|
||||
}
|
||||
},
|
||||
extendMarkdownIt: (f: (md: typeof markdownIt) => void) => {
|
||||
|
||||
Reference in New Issue
Block a user