mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
Continue html renderer cleanup (#28913)
* Removes the `child` option for `IHTMLContentElement`. This is only used internally * Delete some unused functions
This commit is contained in:
@@ -86,56 +86,6 @@ export interface IHTMLContentElement {
|
||||
text?: string;
|
||||
className?: string;
|
||||
inline?: boolean;
|
||||
children?: IHTMLContentElement[];
|
||||
markdown?: string;
|
||||
code?: IHTMLContentElementCode;
|
||||
}
|
||||
|
||||
function htmlContentElementCodeEqual(a: IHTMLContentElementCode, b: IHTMLContentElementCode): boolean {
|
||||
if (!a && !b) {
|
||||
return true;
|
||||
}
|
||||
if (!a || !b) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
a.language === b.language
|
||||
&& a.value === b.value
|
||||
);
|
||||
}
|
||||
|
||||
function htmlContentElementEqual(a: IHTMLContentElement, b: IHTMLContentElement): boolean {
|
||||
return (
|
||||
a.formattedText === b.formattedText
|
||||
&& a.text === b.text
|
||||
&& a.className === b.className
|
||||
&& a.inline === b.inline
|
||||
&& a.markdown === b.markdown
|
||||
&& htmlContentElementCodeEqual(a.code, b.code)
|
||||
&& htmlContentElementArrEquals(a.children, b.children)
|
||||
);
|
||||
}
|
||||
|
||||
export function htmlContentElementArrEquals(a: IHTMLContentElement[], b: IHTMLContentElement[]): boolean {
|
||||
if (!a && !b) {
|
||||
return true;
|
||||
}
|
||||
if (!a || !b) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let aLen = a.length,
|
||||
bLen = b.length;
|
||||
|
||||
if (aLen !== bLen) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0; i < aLen; i++) {
|
||||
if (!htmlContentElementEqual(a[i], b[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user