1
votes

I am using PrimeNG Quill p-editor in angular. By default, quill trimmed extra space. How can I preserve the extra space in editor in quill?

E.g. - model binding property - text = " Hi I am Angular"

Output in editor - "Hi I am Angular"

expected in editor - " Hi I am Angular"


Example of full text :

<p>Data &amp; control</p><ul><li>Comply with Our Code, How do we manage business </li><li>Provide proactive identification and effective management and/or escalation of conduct risk to deliver key customer outcomes</li><li>Own, manage and supervise risks within the business area, ensuring mechanisms are in place to identify</li><li>Ensure risk practices and behaviour are consistent with the target risk culture where work collaboratively with others</li></ul>
2

2 Answers

3
votes

You can use quill parameter preserveWhitespace. set preserveWhitespace to true.

<quill-editro [preserveWhitespace]="true"> </quill-editor>
0
votes

There's maybe an option in Quill configuration but if not, you can replace spaces in front of your string model with &nbsp; :

this.text = "<p>   Desk Strategist </p><ul><li>  value 1</li><li>Value 2   </li><li> Value 3</li><li></ul>";
this.text = this.text.replace(/\s/g, '&nbsp;');

See Plunker