diff --git a/package-lock.json b/package-lock.json
index db80b11..6d9f064 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,34 +1,40 @@
{
- "name": "ykt-wxapp",
- "version": "1.0.0",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "": {
- "name": "ykt-wxapp",
- "version": "1.0.0",
- "license": "ISC",
- "dependencies": {
- "dayjs": "^1.11.10",
- "tim-upload-plugin": "^1.4.2",
- "tim-wx-sdk": "^2.27.6"
- },
- "devDependencies": {}
- },
- "node_modules/dayjs": {
- "version": "1.11.19",
- "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.19.tgz",
- "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
- },
- "node_modules/tim-upload-plugin": {
- "version": "1.4.3",
- "resolved": "https://registry.npmmirror.com/tim-upload-plugin/-/tim-upload-plugin-1.4.3.tgz",
- "integrity": "sha512-3ZmbA36dr3eG9YGDon9MLBUtbNawYWkL+TBa+VS0Uviguc7PlVSOIVRG2C4irXX16slDT2Kj+HAZapp+Xqp2xg=="
- },
- "node_modules/tim-wx-sdk": {
- "version": "2.27.6",
- "resolved": "https://registry.npmmirror.com/tim-wx-sdk/-/tim-wx-sdk-2.27.6.tgz",
- "integrity": "sha512-zB+eRdmigdhEDeqrXC0bLJonUQZzS5uKNPLFtrje503WAnmuxVQjq/n4Zle4FYHG4FiKHKhsrVd0aCYXABlFEg=="
- }
- }
+ "name": "医客通患者端",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "医客通患者端",
+ "version": "1.0.0",
+ "license": "ISC",
+ "dependencies": {
+ "dayjs": "^1.11.10",
+ "mp-html": "^2.5.2",
+ "tim-upload-plugin": "^1.4.2",
+ "tim-wx-sdk": "^2.27.6"
+ },
+ "devDependencies": {}
+ },
+ "node_modules/dayjs": {
+ "version": "1.11.19",
+ "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.19.tgz",
+ "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
+ },
+ "node_modules/mp-html": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmmirror.com/mp-html/-/mp-html-2.5.2.tgz",
+ "integrity": "sha512-45e8c32Qgux4YU4iC3qCSFsOh3y+RwPwZ+iz/vvLkDgSGWk+1zsL4WUzWWQc9w3AsAfkaD/QR0oIufIDngBmXA=="
+ },
+ "node_modules/tim-upload-plugin": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmmirror.com/tim-upload-plugin/-/tim-upload-plugin-1.4.3.tgz",
+ "integrity": "sha512-3ZmbA36dr3eG9YGDon9MLBUtbNawYWkL+TBa+VS0Uviguc7PlVSOIVRG2C4irXX16slDT2Kj+HAZapp+Xqp2xg=="
+ },
+ "node_modules/tim-wx-sdk": {
+ "version": "2.27.6",
+ "resolved": "https://registry.npmmirror.com/tim-wx-sdk/-/tim-wx-sdk-2.27.6.tgz",
+ "integrity": "sha512-zB+eRdmigdhEDeqrXC0bLJonUQZzS5uKNPLFtrje503WAnmuxVQjq/n4Zle4FYHG4FiKHKhsrVd0aCYXABlFEg=="
+ }
+ }
}
diff --git a/package.json b/package.json
index 2d8d0d9..ca66ca0 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
"license": "ISC",
"dependencies": {
"dayjs": "^1.11.10",
+ "mp-html": "^2.5.2",
"tim-upload-plugin": "^1.4.2",
"tim-wx-sdk": "^2.27.6"
},
@@ -27,14 +28,14 @@
"env": {
"UNI_PLATFORM": "mp-weixin"
}
- },
- "pro": {
- "title": "线上",
- "env": {
- "UNI_PLATFORM": "mp-weixin"
- }
+ },
+ "pro": {
+ "title": "线上",
+ "env": {
+ "UNI_PLATFORM": "mp-weixin"
+ }
}
}
},
"devDependencies": {}
-}
\ No newline at end of file
+}
diff --git a/pages/article/article-detail.vue b/pages/article/article-detail.vue
index dfcd655..0f7dbd8 100644
--- a/pages/article/article-detail.vue
+++ b/pages/article/article-detail.vue
@@ -18,7 +18,12 @@
]*)>/gi, (tag, attrs) => {
+ const cleanedAttrs = attrs
+ .replace(/\s+(width|height)\s*=\s*(['"])[\s\S]*?\2/gi, "")
+ .replace(/\s+style\s*=\s*(['"])([\s\S]*?)\1/gi, (match, quote, style) => {
+ const cleanedStyle = style
+ .replace(/(?:^|;)\s*(?:min-|max-)?(?:width|height)\s*:[^;]*/gi, "")
+ .trim();
+ return cleanedStyle ? ` style=${quote}${cleanedStyle}${quote}` : "";
+ });
- // 移除可能存在的固定宽度样式
- processedHtml = processedHtml.replace(
- /style="[^"]*width:\s*\d+px[^"]*"/gi,
- (match) => {
- return match.replace(/width:\s*\d+px;?/gi, "max-width:100%;");
- }
- );
-
- // 处理表格,添加自适应样式
- processedHtml = processedHtml.replace(
- /