From e9b67be77b91a1ac71c351a4632003b219948a2a Mon Sep 17 00:00:00 2001 From: hackrobot Date: Wed, 15 May 2024 23:45:35 +0800 Subject: [PATCH] update --- src/pages/index/index.jsx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/pages/index/index.jsx b/src/pages/index/index.jsx index 6f0b3b4..5a63104 100644 --- a/src/pages/index/index.jsx +++ b/src/pages/index/index.jsx @@ -89,8 +89,13 @@ renderer.image = function (href, title, text) { return `${text}`; }; + +// let listSinbal="▫️ " +let listSinbal="🔸" + // 有序列表 renderer.list = function (body, ordered, start) { + // console.log("body,ordered, start", body, ordered, start); const type = ordered ? "ol" : "ul"; // console.log("type===>", type); @@ -104,17 +109,17 @@ renderer.list = function (body, ordered, start) { // 不含▫️的元素数量 // const diffcCount=texts.length-texts.filter(item => item.includes('▫️')).length; // console.log("texts===>", texts); // 输出: ["测试111", "测试222", "if"] - const newArray = texts.filter((item) => item.includes("▫️")); + const newArray = texts.filter((item) => item.includes(listSinbal)); // 0️⃣', const numbers = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"]; const string = texts .map((value, index) => { // console.log("value, index==>", value, index); // ${ value.indexOf("▫️ ") === -1 ? '
111' : ""} - return value.indexOf("▫️ ") !== -1 + return value.indexOf(listSinbal) !== -1 ? `
${ - type === "ol" ? numbers[newArray.indexOf(value)] : "▫️ " - }${value.replace("▫️ ", "")}
` + type === "ol" ? numbers[newArray.indexOf(value)] : listSinbal + }${value.replace(listSinbal, "")} ` : `
\t${value}
`; }) .join(""); @@ -127,7 +132,10 @@ renderer.list = function (body, ordered, start) { // 无序列表 ▫️ renderer.listitem = function (text, task, checked) { // return `
  • ${text}
  • \n`; - return `▫️ ${text}
    `; + return `${listSinbal}${text}
    ` + // return `➖${text}
    `; + ; + }; // 任务列表 @@ -142,7 +150,8 @@ renderer.checkbox = function (checked) { // 标题 renderer.heading = function (text, level, raw) { // ignore IDs - return `📋${text}
    `; + // return `📋${text}
    `; + return `🔥${text}
    `; // return `${text}\n`; };