diff --git a/src/command/generate/base.ts b/src/command/generate/base.ts index d26cec4..b918a60 100644 --- a/src/command/generate/base.ts +++ b/src/command/generate/base.ts @@ -109,11 +109,16 @@ class GenerateBase extends Base { processContent(content: string) { let that = this // 删除noscript标签内的元素 - function removeNoScript(rawHtml: string) { + function removeUselessEle(rawHtml: string) { + // 规范br标签 rawHtml = _.replace(rawHtml, /<\/br>/g, '') rawHtml = _.replace(rawHtml, /
/g, '
') + // 修复跳转链接 rawHtml = _.replace(rawHtml, /href="\/\/link.zhihu.com'/g, 'href="https://link.zhihu.com') // 修复跳转链接 + // 移除noscript标签 rawHtml = _.replace(rawHtml, /\.*?\<\/noscript\>/g, '') + // 移除script标签 + rawHtml = _.replace(rawHtml, /\