diff --git a/components/fpspreadsheet/source/common/fpshtmlutils.pas b/components/fpspreadsheet/source/common/fpshtmlutils.pas
index 6a82757ac..3d79d2d5f 100644
--- a/components/fpspreadsheet/source/common/fpshtmlutils.pas
+++ b/components/fpspreadsheet/source/common/fpshtmlutils.pas
@@ -842,9 +842,15 @@ begin
AddRichTextParam(FCurrFont);
end;
'
',
- '
': FPlainText := FPlainText + FPS_LINE_ENDING;
- else if (pos('
': begin
FPlainText := FPlainText + FPS_LINE_ENDING;
+ FHandled := True;
+ end;
+ else if (pos('
') then
begin
diff --git a/components/fpspreadsheet/source/common/fpspreadsheet.pas b/components/fpspreadsheet/source/common/fpspreadsheet.pas
index ccb8268c6..942dec0ef 100644
--- a/components/fpspreadsheet/source/common/fpspreadsheet.pas
+++ b/components/fpspreadsheet/source/common/fpspreadsheet.pas
@@ -4122,6 +4122,8 @@ begin
if Length(ARichTextParams) > 0 then
for i:=0 to High(ARichTextParams) do
ACell^.RichTextParams[i] := ARichTextParams[i];
+ if pos(FPS_LINE_ENDING, AText) > 0 then
+ WriteWordWrap(ACell, true);
end;
ChangedCell(ACell^.Row, ACell^.Col);