update
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
logs
|
||||
*.log
|
||||
|
||||
src
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
|
||||
@@ -147,16 +147,23 @@ renderer.checkbox = function (checked) {
|
||||
|
||||
// 标题
|
||||
renderer.heading = function (text, level, raw) {
|
||||
console.log('text, level, raw', text, level, raw);
|
||||
// ignore IDs
|
||||
// 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 () {
|
||||
console.log('hr')
|
||||
// return '<hr>\n';
|
||||
return '➖➖➖➖➖<br/>';
|
||||
return '➖➖➖➖➖';
|
||||
};
|
||||
|
||||
// 内联样式,使用直角引号「」
|
||||
@@ -229,6 +236,19 @@ renderer.link = function (href, title, text) {
|
||||
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 });
|
||||
|
||||
@@ -252,7 +272,8 @@ const Index = () => {
|
||||
}
|
||||
};
|
||||
const onInput = (onInputtxt: any) => {
|
||||
console.log('onInputtxt--->', onInputtxt);
|
||||
console.log('onInputtxt--->', onInputtxt?.target?.value);
|
||||
setinputValue(onInputtxt.target.value);
|
||||
// console.log('inputValue',inputValue)
|
||||
let value = onInputtxt?.target?.value;
|
||||
if (value) {
|
||||
@@ -262,6 +283,8 @@ const Index = () => {
|
||||
|
||||
useEffect(() => {}, []);
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="index">
|
||||
<div className="left">
|
||||
@@ -271,13 +294,8 @@ const Index = () => {
|
||||
className="TextArea"
|
||||
autoFocus
|
||||
allowClear
|
||||
// focus
|
||||
// onConfirm={onConfirm}
|
||||
// onBlur={onBlur}
|
||||
onChange={onInput}
|
||||
// maxlength={-1}
|
||||
showCount
|
||||
// value={inputValue}
|
||||
/>
|
||||
</div>
|
||||
{markText ? (
|
||||
|
||||
Reference in New Issue
Block a user