mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
Continue refactoring html content renderer (#29060)
* Splits `renderHtml` into three distict functions to prevent passing in mixed content types * Moves the `inline` and `className` properties onto the `RenderOptions` structure
This commit is contained in:
@@ -12,11 +12,6 @@
|
||||
*/
|
||||
export type MarkedString = string | { readonly language: string; readonly value: string };
|
||||
|
||||
export interface IHTMLContentElementCode {
|
||||
language: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export function markedStringsEquals(a: MarkedString | MarkedString[], b: MarkedString | MarkedString[]): boolean {
|
||||
if (!a && !b) {
|
||||
return true;
|
||||
@@ -29,9 +24,9 @@ export function markedStringsEquals(a: MarkedString | MarkedString[], b: MarkedS
|
||||
if (!Array.isArray(b)) {
|
||||
return false;
|
||||
}
|
||||
return markedStringArrEquals(<MarkedString[]>a, <MarkedString[]>b);
|
||||
return markedStringArrEquals(a, b);
|
||||
}
|
||||
return markedStringEqual(<MarkedString>a, <MarkedString>b);
|
||||
return markedStringEqual(a, b as MarkedString);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,15 +72,3 @@ export function removeMarkdownEscapes(text: string): string {
|
||||
}
|
||||
return text.replace(/\\([\\`*_{}[\]()#+\-.!])/g, '$1');
|
||||
}
|
||||
|
||||
export interface IHTMLContentElement {
|
||||
/**
|
||||
* supports **bold**, __italics__, and [[actions]]
|
||||
*/
|
||||
formattedText?: string;
|
||||
text?: string;
|
||||
className?: string;
|
||||
inline?: boolean;
|
||||
markdown?: string;
|
||||
code?: IHTMLContentElementCode;
|
||||
}
|
||||
Reference in New Issue
Block a user