Hot fix after some reload minimized composer should be lost body
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -19,6 +19,8 @@ class HideDraftSignatureTransformer extends DomTransformer {
|
||||
final currentStyle = signature.attributes['style']?.trim();
|
||||
if (currentStyle == null) {
|
||||
signature.attributes['style'] = 'display: none;';
|
||||
} else if (currentStyle.contains('display: block;') == true) {
|
||||
signature.attributes['style'] = currentStyle.replaceFirst('display: block;', 'display: none;');
|
||||
} else if (currentStyle.endsWith(';')) {
|
||||
signature.attributes['style'] = '$currentStyle display: none;';
|
||||
} else {
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:typed_data';
|
||||
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:core/domain/exceptions/string_exception.dart';
|
||||
import 'package:html/parser.dart';
|
||||
import 'package:http_parser/http_parser.dart';
|
||||
|
||||
class StringConvert {
|
||||
@@ -107,4 +108,16 @@ class StringConvert {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static String getContentOriginal(String content) {
|
||||
try {
|
||||
final emailDocument = parse(content);
|
||||
final contentOriginal = emailDocument.body?.innerHtml ?? content;
|
||||
log('StringConvert::getContentOriginal:contentOriginal = $contentOriginal');
|
||||
return contentOriginal;
|
||||
} catch (e) {
|
||||
logError('StringConvert::getContentOriginal:Exception = $e');
|
||||
return content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user