fix: 任务栏优化
This commit is contained in:
@@ -106,7 +106,6 @@ renderer.list = function (body, ordered, start) {
|
||||
const type = ordered ? 'ol' : 'ul';
|
||||
const startatt = ordered && start !== 1 ? ' start="' + start + '"' : '';
|
||||
|
||||
|
||||
// 移除 `<div>` 和 `</div>` 标签
|
||||
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
|
||||
? `<div>${
|
||||
type === 'ol' ? numbers[newArray.indexOf(value)] : listSinbal
|
||||
type === 'ol'
|
||||
? numbers[newArray.indexOf(value)]
|
||||
: task
|
||||
? ''
|
||||
: listSinbal
|
||||
}${value.replace(listSinbal, '')} </div>`
|
||||
: // : `<div style="white-space:pre;">\t${value}</div>`;
|
||||
`<div style="white-space:pre;">         ┊ ${value}</div>`;
|
||||
: `<div style="white-space:pre;">         ┊ ${value}</div>`;
|
||||
})
|
||||
.join('');
|
||||
|
||||
|
||||
return `${string}`;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// 示例输入
|
||||
const input = `🔸11<br/>🔸22<br/><br/>🔸33`;
|
||||
console.log(renderer.list(input, false, 1));
|
||||
@@ -349,14 +354,14 @@ const Index = () => {
|
||||
// ╰────────────────╯<br>💬 随时欢迎聊天`;
|
||||
|
||||
let contactMe = `<br>➖➖➖➖➖<br>💬 欢迎交流<br>后台私信发送『关键词』: 加群`;
|
||||
// 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(() => {}, []);
|
||||
|
||||
Reference in New Issue
Block a user