diff --git a/changelog.md b/changelog.md
index 00c2461..b1fc6d8 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,8 @@
+# 3.5.3
+
+1. bug fix
+- 修复生成的pdf中, 文章内容错位/丢失问题
+
# 3.5.2
1. bug fix
diff --git a/client/src/pages/customer_task/utils.ts b/client/src/pages/customer_task/utils.ts
index b4024b3..b185c2d 100644
--- a/client/src/pages/customer_task/utils.ts
+++ b/client/src/pages/customer_task/utils.ts
@@ -137,7 +137,7 @@ export function startBackupTask() {
}
export async function asyncCheckNeedUpdate() {
- let checkUpgradeUri = 'https://cdn.jsdelivr.net/gh/YaoZeyuan/stablog@master/upgrade_config/version.json';
+ let checkUpgradeUri = 'https://gitee.com/yaozeyuan/stablog/raw/master/upgrade_config/version.json';
let remoteVersionConfig = await http
.asyncGet(checkUpgradeUri, {
params: {
diff --git a/package.json b/package.json
index 00a97bb..adc90da 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "stablog",
- "version": "3.5.2",
+ "version": "3.5.3",
"description": "稳部落. 专业备份微blog, 老铁, 稳!",
"repository": {
"type": "git",
@@ -70,13 +70,14 @@
"@adonisjs/ace": "^5.0.8",
"archiver": "^3.0.0",
"axios": "^1.7.7",
+ "better-sqlite3": "^11.5.0",
"cross-env": "^5.2.0",
"dayjs": "^1.11.13",
"decode-html": "^2.0.0",
"dotenv": "^4.0.0",
"fflate": "^0.8",
"fs-extra": "^10.0.0",
- "image-size": "^0.8.3",
+ "image-size": "^1.1.1",
"json5": "^2.1.0",
"jspdf": "^2.3.0",
"knex": "^2.2.0",
@@ -89,8 +90,7 @@
"request": "^2.88.2",
"request-promise": "^4.2.6",
"sharp": "^0.33.5",
- "shelljs": "^0.8.5",
- "better-sqlite3": "^11.5.0"
+ "shelljs": "^0.8.5"
},
"devDependencies": {
"@babel/cli": "^7.18.6",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 38d828e..adad825 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -39,8 +39,8 @@ importers:
specifier: ^10.0.0
version: 10.1.0
image-size:
- specifier: ^0.8.3
- version: 0.8.3
+ specifier: ^1.1.1
+ version: 1.1.1
json5:
specifier: ^2.1.0
version: 2.2.3
@@ -2923,9 +2923,9 @@ packages:
engines: {node: '>=0.10.0'}
hasBin: true
- image-size@0.8.3:
- resolution: {integrity: sha512-SMtq1AJ+aqHB45c3FsB4ERK0UCiA2d3H1uq8s+8T0Pf8A3W4teyBQyaFaktH6xvZqh+npwlKU7i4fJo0r7TYTg==}
- engines: {node: '>=6.9.0'}
+ image-size@1.1.1:
+ resolution: {integrity: sha512-541xKlUw6jr/6gGuk92F+mYM5zaFAc5ahphvkqvNe2bQ6gVBkd6bfrmVJ2t4KDAfikAYZyIqTnktX3i6/aQDrQ==}
+ engines: {node: '>=16.x'}
hasBin: true
import-fresh@3.3.0:
@@ -3965,8 +3965,8 @@ packages:
queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
- queue@6.0.1:
- resolution: {integrity: sha512-AJBQabRCCNr9ANq8v77RJEv73DPbn55cdTb+Giq4X0AVnNVZvMHlYp7XlQiN+1npCZj1DuSmaA2hYVUUDgxFDg==}
+ queue@6.0.2:
+ resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==}
quick-lru@5.1.1:
resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==}
@@ -8216,9 +8216,9 @@ snapshots:
image-size@0.5.5:
optional: true
- image-size@0.8.3:
+ image-size@1.1.1:
dependencies:
- queue: 6.0.1
+ queue: 6.0.2
import-fresh@3.3.0:
dependencies:
@@ -9335,7 +9335,7 @@ snapshots:
queue-microtask@1.2.3: {}
- queue@6.0.1:
+ queue@6.0.2:
dependencies:
inherits: 2.0.4
diff --git a/src/command/debug.ts b/src/command/debug.ts
index 8edc812..e1a11a1 100644
--- a/src/command/debug.ts
+++ b/src/command/debug.ts
@@ -8,8 +8,6 @@ import path from 'path'
// import { BrowserWindow } from 'electron'
// import CommonUtil from '~/src/library/util/common'
// import { TypeTransConfigPackageList } from './generate/trans_config'
-import imageSize from 'image-size'
-import * as mozjpeg from "mozjpeg-js"
import sharp from "sharp"
// const outputUri = path.resolve('F:/www/share/github/stablog/缓存文件/pdf_debug_1.pdf')
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, /\