You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using the RichTextEditor in Delta format (JSON) mode, and the value is bound to a String field that is stored in the database. When the component is loaded with existing Delta format data then extra whitespace is removed (tabs, spaces).
Expected outcome
We'd expect the text to appear as it was when it was saved, with extra whitespaces preserved.
For example when populating the component with this data: [{"attributes":{"bold":true},"insert":"Line 1"},{"insert":"\n\tIndent 1\n\t\tIndent 2\nLast line with\textra spaces and a \ttab\n\n"}]
then when expect to get the same data back, but now we get: [{"attributes":{"bold":true},"insert":"Line 1"},{"insert":"\nIndent 1\nIndent 2\nLast line with extra spaces and a tab\n"}]
@TatuLund Yes I think you're right that it's Jsoup that strips the white spaces. I ran the application in the debugger and when RichTextEditor.sanitize was called with the following input:
<p><strong>Line 1</strong></p><p> Indent 1</p><p> Indent 2</p><p>Last line with extra spaces and a tab</p>
then it returned:
<p><strong>Line 1</strong></p>
<p>Indent 1</p>
<p>Indent 2</p>
<p>Last line with extra spaces and a tab</p>
Description
We're using the RichTextEditor in Delta format (JSON) mode, and the value is bound to a String field that is stored in the database. When the component is loaded with existing Delta format data then extra whitespace is removed (tabs, spaces).
Expected outcome
We'd expect the text to appear as it was when it was saved, with extra whitespaces preserved.
For example when populating the component with this data:
[{"attributes":{"bold":true},"insert":"Line 1"},{"insert":"\n\tIndent 1\n\t\tIndent 2\nLast line with\textra spaces and a \ttab\n\n"}]
then when expect to get the same data back, but now we get:
[{"attributes":{"bold":true},"insert":"Line 1"},{"insert":"\nIndent 1\nIndent 2\nLast line with extra spaces and a tab\n"}]
Minimal reproducible example
Steps to reproduce
Environment
Vaadin version(s): 24.1.10
OS: Windows 10
Browsers
Chrome
The text was updated successfully, but these errors were encountered: