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:
Matt Bierner
2017-06-19 08:06:46 -07:00
committed by GitHub
parent bba6037b11
commit 54b8d4d9e9
4 changed files with 3 additions and 105 deletions

View File

@@ -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;
}
}