Files
RSSHub/lib/routes/mrdx/utils.js
T
2024-03-01 01:24:49 +08:00

18 lines
389 B
JavaScript

function getElementChildrenInnerText(element) {
let text = '';
for (const child of element.children) {
if (child.type === 'text') {
text += child.data.trim();
}
if (child.children !== undefined) {
text += getElementChildrenInnerText(child);
}
}
return text;
}
module.exports = {
getElementChildrenInnerText,
};