mirror of
https://github.com/feeddeck/feeddeck.git
synced 2026-05-30 23:36:26 -05:00
[core] Fix Converting of HTML to Plain Text in Description (#96)
This commit fixes the conversion of HTML to plain text in the description for an item. Until now it could happen, that the there was no whitespace between some words after the conversion. This is now fixed so that there is always a whitespace between words in the plain text.
This commit is contained in:
@@ -158,7 +158,9 @@ class ItemDescription extends StatelessWidget {
|
||||
if (sourceFormat == DescriptionFormat.html &&
|
||||
tagetFormat == DescriptionFormat.plain) {
|
||||
return _buildPlain(
|
||||
itemDescription!.replaceAll(RegExp(r'<[^>]*>|&[^;]+;'), ''),
|
||||
itemDescription!
|
||||
.replaceAll(RegExp(r'<[^>]*>|&[^;]+;'), ' ')
|
||||
.replaceAll(RegExp('\\s+'), ' '),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,9 @@ class ItemDescription extends StatelessWidget {
|
||||
if (sourceFormat == DescriptionFormat.html &&
|
||||
tagetFormat == DescriptionFormat.plain) {
|
||||
return _buildPlain(
|
||||
itemDescription!.replaceAll(RegExp(r'<[^>]*>|&[^;]+;'), ''),
|
||||
itemDescription!
|
||||
.replaceAll(RegExp(r'<[^>]*>|&[^;]+;'), ' ')
|
||||
.replaceAll(RegExp('\\s+'), ' '),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user