diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 8ea6972..b7ac9c4 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -106,7 +106,6 @@ renderer.list = function (body, ordered, start) { const type = ordered ? 'ol' : 'ul'; const startatt = ordered && start !== 1 ? ' start="' + start + '"' : ''; - // 移除 `
` 和 `
` 标签 const cleanedBody = body.replace(/<\/?div>/g, ''); @@ -129,21 +128,27 @@ renderer.list = function (body, ordered, start) { // ┊ │ ╏ const string = texts .map((value, index) => { + console.log('value--', value); + // 判断是否是任务 + let task = false; + if (value.includes('🔸❌') || value.includes('🔸✅')) { + task = true; + } return value.indexOf(listSinbal) !== -1 ? `
${ - type === 'ol' ? numbers[newArray.indexOf(value)] : listSinbal + type === 'ol' + ? numbers[newArray.indexOf(value)] + : task + ? '' + : listSinbal }${value.replace(listSinbal, '')}
` - : // : `
\t${value}
`; - `
         ┊ ${value}
`; + : `
         ┊ ${value}
`; }) .join(''); - + return `${string}`; }; - - - // 示例输入 const input = `🔸11
🔸22

🔸33`; console.log(renderer.list(input, false, 1)); @@ -349,14 +354,14 @@ const Index = () => { // ╰────────────────╯
💬 随时欢迎聊天`; let contactMe = `
➖➖➖➖➖
💬 欢迎交流
后台私信发送『关键词』: 加群`; - // setmarkText(value); + setmarkText(value); // setmarkText(value + contactMe); - if (value?.length < 10) { - setmarkText(value); - } else { - setmarkText(value + contactMe); - } + // if (value?.length < 10) { + // setmarkText(value); + // } else { + // setmarkText(value + contactMe); + // } }; useEffect(() => {}, []);