[ADF-3230] Changes to stop doc tools from updating files unnecessarily (#3519)

* [ADF-3230] Added basic change detector to doc tools

* [ADF-3230] Updates to type linker to fix before/after inconsistencies

* [ADF-3230] Fixed comparison error caused by adjacent text blocks

* [ADF-3230] Added basic change detector to doc tools

* [ADF-3230] Updates to type linker to fix before/after inconsistencies

* [ADF-3230] Fixed comparison error caused by adjacent text blocks

* [ADF-3230] Modified props tool to remove spaces from union types

* [ADF-3230] Made ToC tool before/after state consistent
This commit is contained in:
Andy Stark
2018-06-22 13:24:38 +01:00
committed by Eugenio Romano
parent 6584bc307e
commit 5a3ce3d299
12 changed files with 168 additions and 53 deletions

View File

@@ -65,6 +65,13 @@ export class MDNav {
}
headings(test: (element: any) => boolean = () => true, index: number = 0): MDNav[] {
return this.findAll((h) => {
return h.type === "heading" && test(h);
}, index);
}
html(test: (element: any) => boolean = () => true, index: number = 0): MDNav {
return this.find((h) => {
return h.type === "html" && test(h);
@@ -160,4 +167,23 @@ export class MDNav {
return "";
}
}
get textValue() : string {
if (this.item) {
if (this.item["value"]) {
return this.item.value;
} else if (
this.item.children &&
(this.item.children.length > 0) &&
(this.item.children[0].type === "text")
){
return this.item.children[0].value;
} else {
return "";
}
} else {
return "";
}
}
}