update
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
|
src
|
||||||
|
|
||||||
# Runtime data
|
# Runtime data
|
||||||
pids
|
pids
|
||||||
*.pid
|
*.pid
|
||||||
|
|||||||
@@ -147,16 +147,23 @@ renderer.checkbox = function (checked) {
|
|||||||
|
|
||||||
// 标题
|
// 标题
|
||||||
renderer.heading = function (text, level, raw) {
|
renderer.heading = function (text, level, raw) {
|
||||||
|
console.log('text, level, raw', text, level, raw);
|
||||||
// ignore IDs
|
// ignore IDs
|
||||||
// return `📋<span>${text}</span> <br/>`;
|
// return `📋<span>${text}</span> <br/>`;
|
||||||
return `🔥<span>${text}</span> <br/>`;
|
return `🔥<span>${text}</span> <br/>`;
|
||||||
// return `<h${level}>${text}</h${level}>\n`;
|
// return `<h${level}>🔥<span>${text}</span></h${level}>\n`;
|
||||||
|
// return `<h${level}>🔥${text}</h${level}><br/>`;
|
||||||
|
};
|
||||||
|
|
||||||
|
renderer.text = function (text) {
|
||||||
|
return text;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 分隔符
|
// 分隔符
|
||||||
renderer.hr = function () {
|
renderer.hr = function () {
|
||||||
|
console.log('hr')
|
||||||
// return '<hr>\n';
|
// return '<hr>\n';
|
||||||
return '➖➖➖➖➖<br/>';
|
return '➖➖➖➖➖';
|
||||||
};
|
};
|
||||||
|
|
||||||
// 内联样式,使用直角引号「」
|
// 内联样式,使用直角引号「」
|
||||||
@@ -229,6 +236,19 @@ renderer.link = function (href, title, text) {
|
|||||||
return out;
|
return out;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
renderer.paragraph= function(text) {
|
||||||
|
return `<p>${text}</p>\n`;
|
||||||
|
}
|
||||||
|
renderer.br= function() {
|
||||||
|
return '<br>';
|
||||||
|
}
|
||||||
|
renderer.html= function(html, block) {
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自定义分隔线解析规则
|
||||||
|
// marked.Lexer.rules.block.gfm.hr = /^(\*{3,}|-{3,}|_{3,})(?:\s*)$/;
|
||||||
// 使用拓展
|
// 使用拓展
|
||||||
marked.use({ renderer });
|
marked.use({ renderer });
|
||||||
|
|
||||||
@@ -252,7 +272,8 @@ const Index = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onInput = (onInputtxt: any) => {
|
const onInput = (onInputtxt: any) => {
|
||||||
console.log('onInputtxt--->', onInputtxt);
|
console.log('onInputtxt--->', onInputtxt?.target?.value);
|
||||||
|
setinputValue(onInputtxt.target.value);
|
||||||
// console.log('inputValue',inputValue)
|
// console.log('inputValue',inputValue)
|
||||||
let value = onInputtxt?.target?.value;
|
let value = onInputtxt?.target?.value;
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -262,6 +283,8 @@ const Index = () => {
|
|||||||
|
|
||||||
useEffect(() => {}, []);
|
useEffect(() => {}, []);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="index">
|
<div className="index">
|
||||||
<div className="left">
|
<div className="left">
|
||||||
@@ -271,13 +294,8 @@ const Index = () => {
|
|||||||
className="TextArea"
|
className="TextArea"
|
||||||
autoFocus
|
autoFocus
|
||||||
allowClear
|
allowClear
|
||||||
// focus
|
|
||||||
// onConfirm={onConfirm}
|
|
||||||
// onBlur={onBlur}
|
|
||||||
onChange={onInput}
|
onChange={onInput}
|
||||||
// maxlength={-1}
|
|
||||||
showCount
|
showCount
|
||||||
// value={inputValue}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{markText ? (
|
{markText ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user