diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 3322bc5..88f83c2 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -59,7 +59,8 @@ const createDecoratedTitleHTML = (text: any) => { const bottomBorder = `${cornerBottomLeft}${edgeLength}${cornerBottomRight}`; const middleLine = ` ๐Ÿ“ข ${text}`; - return `
${topBorder}
${middleLine}
${bottomBorder}

\n`; + // return `
${topBorder}\n${middleLine}\n${bottomBorder}
\n`; + return `
${topBorder}
${middleLine}
${bottomBorder}
\n`; }; marked.setOptions({ @@ -110,7 +111,9 @@ renderer.list = function (body, ordered, start) { const startatt = ordered && start !== 1 ? ' start="' + start + '"' : ''; // ๆญฃๅˆ™ๅ–ๅ€ผ // const regex = /โ–ซ๏ธ\s*(.*?)/g; - const regex = /([^<]*)/g; + // const regex = /([^<]*)/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 `
  • ${text}
  • \n`; - return `${listSinbal}${text}
    `; + // return `${listSinbal}${text}
    `; + return `${listSinbal}${text}\n`; + // return `โž–${text}
    `; }; @@ -164,15 +169,12 @@ renderer.heading = function (text, level, raw) { return createDecoratedTitleHTML(text); } else if (level == 2) { return `
    ๐Ÿ”ฅ${text}
    \n`; + // return `
    ๐Ÿ”ฅ${text}

    `; } else { return `
    ๐Ÿ”ฅ${text}
    \n`; + // return `
    ๐Ÿ”ฅ${text}

    `; } - return `
    โ•”โ•โ”โ”€โ”€โ”€โ”€โ”€โ”€โ”โ•โ•—
    - ๐Ÿ”ฅ ${text}
    -โ•šโ•โ”โ”€โ”€โ”€โ”€โ”€โ”€โ”โ•โ• -
    \n`; - // return `
    * * * * * * * * * * *
    // * ${text} *
    // * * * * * * * * * * * @@ -279,7 +281,9 @@ renderer.link = function (href, title, text) { renderer.paragraph = function (text) { // return `

    ${text}

    \n`; // return `

    ${text}

    `; - return `
    ${text}
    `; + // return `
    ${text}
    `; + // return `
    ${text}

    `; + return `
    ${text}
    \n`; }; renderer.br = function () { return '
    '; @@ -318,43 +322,44 @@ const Index = () => { // let value = onInputtxt?.target?.value; let value = onInputtxt?.target?.value; - if (value?.length > 10) { - // +`๐Ÿ…ฅ๐ŸŸข๐Ÿ†”:hackrobot` - // +`โž•๐Ÿ…ฅ=>๐ŸŸฉ๐Ÿ†”: hackrobot,ๅฏไปฅๆ‰พๆˆ‘่Šๅคฉ๐Ÿ’ฌ ` - // let contactMe=`
    โž–โž–โž–โž–โž–
    ๅœจ๐ŸŸฉใ€wฮž๐—ซ๐—œ๐—กใ€‘โžก๏ธ่”็ณปๆˆ‘ ใ€โž•๐Ÿ…ฅใ€‘: - // โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ - // โ”‚ ๐Ÿ†” hackrobot - // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ - // ๐Ÿ’ฌ ้šๆ—ถๆฌข่ฟŽ่Šๅคฉ - // ` + // +`๐Ÿ…ฅ๐ŸŸข๐Ÿ†”:hackrobot` + // +`โž•๐Ÿ…ฅ=>๐ŸŸฉ๐Ÿ†”: hackrobot,ๅฏไปฅๆ‰พๆˆ‘่Šๅคฉ๐Ÿ’ฌ ` + // let contactMe=`
    โž–โž–โž–โž–โž–
    ๅœจ๐ŸŸฉใ€wฮž๐—ซ๐—œ๐—กใ€‘โžก๏ธ่”็ณปๆˆ‘ ใ€โž•๐Ÿ…ฅใ€‘: + // โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ + // โ”‚ ๐Ÿ†” hackrobot + // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ + // ๐Ÿ’ฌ ้šๆ—ถๆฌข่ฟŽ่Šๅคฉ + // ` + // โ”‚ ๐Ÿ’ฌ ้šๆ—ถๆฌข่ฟŽ่Šๅคฉ - // โ”‚ ๐Ÿ’ฌ ้šๆ—ถๆฌข่ฟŽ่Šๅคฉ - let contactMe = `
    โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ -โ”‚ ๐ŸŸฉใ€wฮž๐—ซ๐—œ๐—กใ€‘โžก๏ธ่”็ณปๆˆ‘ใ€โž•๐Ÿ…ฅใ€‘ -โ”‚ -โ”‚ ๐Ÿ†” hackrobot -โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
    ๐Ÿ’ฌ ้šๆ—ถๆฌข่ฟŽ่Šๅคฉ`; + // let contactMe = `
    โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ + // โ”‚ ๐ŸŸฉใ€wฮž๐—ซ๐—œ๐—กใ€‘โžก๏ธ่”็ณปๆˆ‘ใ€โž•๐Ÿ…ฅใ€‘ + // โ”‚ + // โ”‚ ๐Ÿ†” hackrobot + // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
    ๐Ÿ’ฌ ้šๆ—ถๆฌข่ฟŽ่Šๅคฉ`; - if (value?.length < 10) { - setmarkText(value); - } else { - setmarkText(value + contactMe); - } - } + // let contactMe = `
    \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(() => {