We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0d03cc commit ce7ea6cCopy full SHA for ce7ea6c
components/api.ts
@@ -86,13 +86,15 @@ export class Trope {
86
const titleElement = document.querySelector(
87
".wrap-entry-breadcrumb strong"
88
);
89
- const text = Array.prototype.filter
90
- .call(
91
- titleElement?.childNodes,
92
- (child) => child.nodeType === Node.TEXT_NODE
93
- )
94
- .map((child) => child.textContent)
95
- .join("");
+ const text = titleElement
+ ? Array.prototype.filter
+ .call(
+ titleElement?.childNodes,
+ (child) => child.nodeType === Node.TEXT_NODE
+ )
+ .map((child) => child.textContent)
96
+ .join("")
97
+ : null;
98
if (text) {
99
return text.trim();
100
}
0 commit comments