From 7d1a8d56448de17a3cf4c48fba1be16348c2e872 Mon Sep 17 00:00:00 2001 From: Yang Libin Date: Wed, 16 Mar 2022 09:52:34 +0800 Subject: [PATCH] fix: list item tag (#139) --- src/assets/scripts/renderers/wx-renderer.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/assets/scripts/renderers/wx-renderer.js b/src/assets/scripts/renderers/wx-renderer.js index 07cb9e0..bf40e92 100644 --- a/src/assets/scripts/renderers/wx-renderer.js +++ b/src/assets/scripts/renderers/wx-renderer.js @@ -136,22 +136,22 @@ class WxRenderer { renderer.codespan = (text, lang) => `${text}`; renderer.listitem = (text) => - `<%s/>${text}`; + )}><%s/>${text}`; renderer.list = (text, ordered, start) => { text = text.replace(/<\/*p.*?>/g, ""); let segments = text.split(`<%s/>`); if (!ordered) { - text = segments.join("•"); - return `

${text}

`; + text = segments.join("• "); + return ``; } text = segments[0]; for (let i = 1; i < segments.length; i++) { - text = text + i + "." + segments[i]; + text = text + i + ". " + segments[i]; } - return `

${text}

`; + return `
    ${text}
`; }; renderer.image = (href, title, text) => { let subText = "";