koishi-plugin-fimtale-api 0.0.99 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +6 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -78,7 +78,7 @@ function apply(ctx, config) {
|
|
|
78
78
|
}, "generateGradient");
|
|
79
79
|
const cleanContent = /* @__PURE__ */ __name((html) => {
|
|
80
80
|
if (!html) return "";
|
|
81
|
-
return html.replace(/style\s*=\s*['"][^'"]*['"]/gi, "").replace(/<p[^>]*>\s*(?:<br\s*\/?>| | |\s| )*\s*<\/p>/gi, "").replace(
|
|
81
|
+
return html.replace(/style\s*=\s*['"][^'"]*['"]/gi, "").replace(/<p[^>]*>\s*(?:<br\s*\/?>| | |\s| )*\s*<\/p>/gi, "").replace(/(<br\s*\/?>\s*){2,}/gi, "<br>").replace(/<\/p>\s*<br\s*\/?>\s*<p/gi, "</p><p>").replace(/<p[^>]*>\s*<br\s*\/?>/gi, "<p>").replace(/<br\s*\/?>\s*<\/p>/gi, "</p>").replace(/(?:<br\s*\/?>| |\s)+$/gi, "").trim();
|
|
82
82
|
}, "cleanContent");
|
|
83
83
|
const fontStack = '"Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif';
|
|
84
84
|
const fontSerif = '"Noto Serif SC", "Source Han Serif SC", "SimSun", serif';
|
|
@@ -418,8 +418,11 @@ function apply(ctx, config) {
|
|
|
418
418
|
transition: none;
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
/*
|
|
422
|
-
p {
|
|
421
|
+
/* 段落间距优化:0.4em 是一个平衡点,紧凑但区分清晰 */
|
|
422
|
+
p {
|
|
423
|
+
margin: 0 0 0.4em 0;
|
|
424
|
+
text-indent: 2em;
|
|
425
|
+
}
|
|
423
426
|
/* 防止最后一段下边距导致额外分页 */
|
|
424
427
|
p:last-child { margin-bottom: 0; }
|
|
425
428
|
|