【问题标题】:p:textEditor <br> line separator instead of <p>p:textEditor <br> 行分隔符而不是 <p>
【发布时间】:2017-09-02 16:14:09
【问题描述】:

我正在为我的论坛使用 JSF (PrimeFaces) 标签 p:textEditor。此标签使用 Quill 富文本编辑器。默认行为是将每一行包装在块中(在段落标签中包装 p /p):

<p>line1</p> 

<p>line2</p> .... 

而且它看起来不太好,因为输出的行之间的空格太多。 相反,我需要这样(在行之间使用标签 br/):

<br/> line1
<br/>line2 .....

例如,PrimeFaces 扩展有标签pe:ckEditor,它使用ckEditor(富文本编辑器)。我可以改变它的行为,只需在config.js 文件中添加"config.enterMode = CKEDITOR.ENTER_BR;"

p:textEditor 和它的 Quill(富文本编辑器)中是否有相同的功能或其他可以解决我的问题的方法?

【问题讨论】:

标签: primefaces quill


【解决方案1】:

我正在调查 Quills owner - https://github.com/quilljs/quill/issues/1074 . And I checked all new versions after this feedback. So yet Quill does not has this ability. The owner suggests to use css-style for fixing this behaviour (adjust paddings). Yes, it can resolve a problem of big spaces, but: 1) this way is not so comfortable; 2) this way is not suitable for forums 报价的反馈,因为将自己报价中的每一行分开。

Here 讨论了这个问题,here 是一些解决它的 js 方法。但我不会使用它,因为我使用的是内置在 JSF 库中的 Quill。所以我切换到 pe:ckEditor 和 ckEditor 富文本编辑器

【讨论】: