Reactjs 在回车时添加额外的换行符
我正在使用react羽毛笔,并将包装从更换为,但是,存在额外断线的问题 这是我的输入,我希望它在后端传递时是什么样子(qna maker)Reactjs 在回车时添加额外的换行符,reactjs,quill,Reactjs,Quill,我正在使用react羽毛笔,并将包装从更换为,但是,存在额外断线的问题 这是我的输入,我希望它在后端传递时是什么样子(qna maker) 测试1 测试2 测试3 但情况是这样的: <div> test1 </div> <div> test2 </div> <div> test3 </div> test1 测试2 测试3 因此,当我将其传递到后端时,它会像这样保存 test1\n\ntest2\n\ntest3当我实
测试1
测试2
测试3
但情况是这样的:
<div> test1 </div>
<div> test2 </div>
<div> test3 </div>
test1
测试2
测试3
因此,当我将其传递到后端时,它会像这样保存
test1\n\ntest2\n\ntest3当我实际上只想将其保存为test1\ntest2\ntest3
我用过这个:
var Block = Quill.import('blots/block');
Block.tagName = 'DIV';
Quill.register(Block, true);
```````
<ReactQuill
value={this.props.value}
onChange={this.handleChange}
onBlur={this.setProps}
modules={this.modules}
formats={this.formats}
/>
var Block=Quill.import('blots/Block');
Block.tagName='DIV';
套筒寄存器(块,真);
```````
这是正在保存的标记:
<div>click <a href=\"https://twitter.com\" target=\"_blank\">here </a> for sample link test test testing test new line sample link <a href=\"https://www.google.com\" target=\"_blank\">here</a>.. and then <a href=\"https://www.facebook.com\" target=\"_blank\">here</a> test here</div>
<div>endtered value here</div>
<div><br></div>
<div><br></div>
<div>this is a new paragraphs</div>
<div>but this is just a new line</div>
单击以获取样本链接测试新行样本链接。。然后在这里测试
这里有固定值
这是一个新的段落
但这只是一条新路线
这就是qnamaker中的样子
<div>click <a href=\"https://twitter.com\" target=\"_blank\">here </a> for sample link test test testing test new line sample link <a href=\"https://www.google.com\" target=\"_blank\">here</a>.. and then <a href=\"https://www.facebook.com\" target=\"_blank\">here</a> test here</div>
<div>endtered value here</div>
<div><br></div>
<div><br></div>
<div>this is a new paragraphs</div>
<div>but this is just a new line</div>