mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-08 01:28:26 -05:00
Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as DOM from 'vs/base/browser/dom'; // {{SQL CARBON EDIT}} added missing import to fix build break
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { createElement, FormattedTextRenderOptions } from 'vs/base/browser/formattedTextRenderer';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IMarkdownString, parseHrefAndDimensions, removeMarkdownEscapes } from 'vs/base/common/htmlContent';
|
||||
@@ -180,15 +180,6 @@ export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRende
|
||||
});
|
||||
});
|
||||
|
||||
// const promise = Promise.all([value, withInnerHTML]).then(values => {
|
||||
// const span = <HTMLDivElement>element.querySelector(`div[data-code="${id}"]`);
|
||||
// if (span) {
|
||||
// DOM.reset(span, values[0]);
|
||||
// }
|
||||
// }).catch(_err => {
|
||||
// // ignore
|
||||
// });
|
||||
|
||||
if (options.asyncRenderCallback) {
|
||||
promise.then(options.asyncRenderCallback);
|
||||
}
|
||||
@@ -324,6 +315,14 @@ function getInsaneOptions(options: { readonly isTrusted?: boolean }): InsaneOpti
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Strips all markdown from `string`, if it's an IMarkdownString. For example
|
||||
* `# Header` would be output as `Header`. If it's not, the string is returned.
|
||||
*/
|
||||
export function renderStringAsPlaintext(string: IMarkdownString | string) {
|
||||
return typeof string === 'string' ? string : renderMarkdownAsPlaintext(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Strips all markdown from `markdown`. For example `# Header` would be output as `Header`.
|
||||
*/
|
||||
@@ -398,6 +397,7 @@ export function renderMarkdownAsPlaintext(markdown: IMarkdownString) {
|
||||
|
||||
const unescapeInfo = new Map<string, string>([
|
||||
['"', '"'],
|
||||
[' ', ' '],
|
||||
['&', '&'],
|
||||
[''', '\''],
|
||||
['<', '<'],
|
||||
|
||||
Reference in New Issue
Block a user