Compare commits
1 Commits
greenbook
...
feature/em
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9d4450a7c |
@@ -59,7 +59,8 @@ const createDecoratedTitleHTML = (text: any) => {
|
||||
const bottomBorder = `${cornerBottomLeft}${edgeLength}${cornerBottomRight}`;
|
||||
const middleLine = ` 📢 ${text}`;
|
||||
|
||||
return `<div>${topBorder}<br/>${middleLine}<br/>${bottomBorder}</div><br/>\n`;
|
||||
// return `<div>${topBorder}\n${middleLine}\n${bottomBorder}</div>\n`;
|
||||
return `<div>${topBorder}<br/>${middleLine}<br/>${bottomBorder}</div>\n`;
|
||||
};
|
||||
|
||||
marked.setOptions({
|
||||
@@ -110,7 +111,9 @@ renderer.list = function (body, ordered, start) {
|
||||
const startatt = ordered && start !== 1 ? ' start="' + start + '"' : '';
|
||||
// 正则取值
|
||||
// const regex = /▫️\s*(.*?)<br\/?>/g;
|
||||
const regex = /([^<]*)<br\/?>/g;
|
||||
// const regex = /([^<]*)<br\/?>/g;
|
||||
const regex = /([^\n]*)\n/g;
|
||||
|
||||
const input = body;
|
||||
const matches = [...input.matchAll(regex)];
|
||||
const texts = matches.map((match) => match[1]);
|
||||
@@ -141,7 +144,9 @@ renderer.list = function (body, ordered, start) {
|
||||
// 无序列表 ▫️
|
||||
renderer.listitem = function (text, task, checked) {
|
||||
// return `<li>${text}</li>\n`;
|
||||
return `${listSinbal}${text}<br/>`;
|
||||
// return `${listSinbal}${text}<br/>`;
|
||||
return `${listSinbal}${text}\n`;
|
||||
|
||||
// return `➖${text}<br/>`;
|
||||
};
|
||||
|
||||
@@ -164,15 +169,12 @@ renderer.heading = function (text, level, raw) {
|
||||
return createDecoratedTitleHTML(text);
|
||||
} else if (level == 2) {
|
||||
return `<div>🔥${text}</div>\n`;
|
||||
// return `<div>🔥${text}</div><br>`;
|
||||
} else {
|
||||
return `<div>🔥${text}</div>\n`;
|
||||
// return `<div>🔥${text}</div><br>`;
|
||||
}
|
||||
|
||||
return `<div>╔═━──────━═╗<br/>
|
||||
🔥 ${text}<br/>
|
||||
╚═━──────━═╝
|
||||
</div>\n`;
|
||||
|
||||
// return `<div>* * * * * * * * * * *<br/>
|
||||
// * ${text} *<br/>
|
||||
// * * * * * * * * * * *
|
||||
@@ -279,7 +281,9 @@ renderer.link = function (href, title, text) {
|
||||
renderer.paragraph = function (text) {
|
||||
// return `<p>${text}</p>\n`;
|
||||
// return `<p>${text}</p>`;
|
||||
return `<div>${text}</div>`;
|
||||
// return `<div>${text}</div>`;
|
||||
// return `<div>${text}</div><br>`;
|
||||
return `<div>${text}</div>\n`;
|
||||
};
|
||||
renderer.br = function () {
|
||||
return '<br>';
|
||||
@@ -318,7 +322,6 @@ const Index = () => {
|
||||
// let value = onInputtxt?.target?.value;
|
||||
let value = onInputtxt?.target?.value;
|
||||
|
||||
if (value?.length > 10) {
|
||||
// +`🅥🟢🆔:hackrobot`
|
||||
// +`➕🅥=>🟩🆔: hackrobot,可以找我聊天💬 `
|
||||
// let contactMe=`<br>➖➖➖➖➖<br/>在🟩【wΞ𝗫𝗜𝗡】➡️联系我 【➕🅥】:
|
||||
@@ -327,34 +330,36 @@ const Index = () => {
|
||||
// ╰────────────────╯
|
||||
// 💬 随时欢迎聊天
|
||||
// `
|
||||
|
||||
// │ 💬 随时欢迎聊天
|
||||
let contactMe = `<br>╭────────────────╮
|
||||
│ 🟩【wΞ𝗫𝗜𝗡】➡️联系我【➕🅥】
|
||||
│
|
||||
│ 🆔 hackrobot
|
||||
╰────────────────╯<br>💬 随时欢迎聊天`;
|
||||
|
||||
if (value?.length < 10) {
|
||||
setmarkText(value);
|
||||
} else {
|
||||
// let contactMe = `<br>╭────────────────╮
|
||||
// │ 🟩【wΞ𝗫𝗜𝗡】➡️联系我【➕🅥】
|
||||
// │
|
||||
// │ 🆔 hackrobot
|
||||
// ╰────────────────╯<br>💬 随时欢迎聊天`;
|
||||
|
||||
// let contactMe = `<br>\n💬 后台发送关键词: 加群`;
|
||||
let contactMe = `\n💬 后台发送关键词: 加群`;
|
||||
|
||||
setmarkText(value + contactMe);
|
||||
}
|
||||
}
|
||||
// if (value?.length < 10) {
|
||||
// setmarkText(value);
|
||||
// } else {
|
||||
// setmarkText(value + contactMe);
|
||||
// }
|
||||
};
|
||||
|
||||
useEffect(() => {}, []);
|
||||
|
||||
const copyToClipboard = () => {
|
||||
if (divRef.current) {
|
||||
const htmlContentinnerHTML = divRef.current.innerHTML;
|
||||
console.log('htmlContentinnerHTML', htmlContentinnerHTML);
|
||||
const htmlContentouterHTML = divRef.current.outerHTML;
|
||||
console.log('htmlContentouterHTML', htmlContentouterHTML);
|
||||
|
||||
// const htmlContentinnerHTML = divRef.current.innerHTML;
|
||||
// console.log('htmlContentinnerHTML', htmlContentinnerHTML);
|
||||
// const htmlContentouterHTML = divRef.current.outerHTML;
|
||||
// console.log('htmlContentouterHTML', htmlContentouterHTML);
|
||||
const htmlContent = divRef.current.innerText;
|
||||
// const htmlContent = divRef.current.outerHTML;
|
||||
// const htmlContent = divRef.current.textContent;
|
||||
|
||||
navigator.clipboard
|
||||
.writeText(htmlContent)
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user