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