feat(parser): add GridShow and ShowCustomThumbnail

Closes #459
This commit is contained in:
LuanRT
2023-03-15 05:15:16 -03:00
parent b71f03caf2
commit 8ef4b42d44
5 changed files with 64 additions and 9 deletions

View File

@@ -18,7 +18,7 @@ export function escape(text: string) {
.replace(/'/g, ''');
}
class Text {
export default class Text {
text?: string;
runs;
endpoint?: NavigationEndpoint;
@@ -39,8 +39,11 @@ class Text {
if (typeof data === 'object' && data !== null && Reflect.has(data, 'titleNavigationEndpoint')) {
this.endpoint = new NavigationEndpoint(data.titleNavigationEndpoint);
}
if (!this.endpoint)
this.endpoint = (this.runs?.[0] as TextRun)?.endpoint;
if (!this.endpoint) {
if ((this.runs?.[0] as TextRun)?.endpoint) {
this.endpoint = (this.runs?.[0] as TextRun)?.endpoint;
}
}
}
toHTML() {
@@ -54,6 +57,4 @@ class Text {
toString() {
return this.text || 'N/A';
}
}
export default Text;
}