From f397d9184e33c82fc93d40dc2429341f1702b87e Mon Sep 17 00:00:00 2001 From: RedCloud <36195500+DandelionCloud@users.noreply.github.com> Date: Sun, 18 Jun 2023 20:54:42 +0800 Subject: [PATCH] fix: not replace
 in list (#226)

---
 src/assets/scripts/renderers/wx-renderer.js | 2 +-
 src/store/index.js                          | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/assets/scripts/renderers/wx-renderer.js b/src/assets/scripts/renderers/wx-renderer.js
index bf40e92..91a90f9 100644
--- a/src/assets/scripts/renderers/wx-renderer.js
+++ b/src/assets/scripts/renderers/wx-renderer.js
@@ -141,7 +141,7 @@ class WxRenderer {
         )}><%s/>${text}`;
 
       renderer.list = (text, ordered, start) => {
-        text = text.replace(/<\/*p.*?>/g, "");
+        text = text.replace(/<\/*p .*?>/g, "").replace(/<\/*p>/g, "");
         let segments = text.split(`<%s/>`);
         if (!ordered) {
           text = segments.join("• ");
diff --git a/src/store/index.js b/src/store/index.js
index efb9afd..5bfe8ae 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -178,6 +178,7 @@ const mutations = {
             display: -webkit-box;
             padding: 0.5em 1em 1em;
             overflow-x: auto;
+            text-indent: 0;
           }
         
       `