diff --git a/lib/v2/zhihu/timeline.js b/lib/v2/zhihu/timeline.js index ed648dc19..67162a370 100644 --- a/lib/v2/zhihu/timeline.js +++ b/lib/v2/zhihu/timeline.js @@ -53,13 +53,28 @@ module.exports = async (ctx) => { return actors.map((e) => e.name).join(', '); }; + const getContent = (content) => { + if (!content || !Array.isArray(content)) { + return content; + } + // content can be a string or an array of objects + return ( + content + .map((e) => e.content) + .filter((e) => e instanceof String && !!e) + // some content may not be wrapped in tag, it will cause error when parsing + .map((e) => `