diff --git a/core/lib/data/network/download/download_client.dart b/core/lib/data/network/download/download_client.dart
index e3e6461d8..d18917f28 100644
--- a/core/lib/data/network/download/download_client.dart
+++ b/core/lib/data/network/download/download_client.dart
@@ -119,7 +119,7 @@ class DownloadClient {
fileName = fileName.split('.').first;
}
mimeType = HtmlUtils.validateHtmlImageResourceMimeType(mimeType);
- final base64Uri = '
';
+ final base64Uri = '
';
return base64Uri;
}
}
\ No newline at end of file
diff --git a/core/lib/utils/html/html_interaction.dart b/core/lib/utils/html/html_interaction.dart
index 63a6104e7..d7308fb20 100644
--- a/core/lib/utils/html/html_interaction.dart
+++ b/core/lib/utils/html/html_interaction.dart
@@ -158,22 +158,9 @@ class HtmlInteraction {
function normalizeStyleAttribute(attrs) {
// Normalize style attribute to ensure proper responsive behavior
let style = attrs['style'];
- const widthStr = attrs['width'];
if (!style) {
- if (!widthStr) {
- attrs['style'] = 'max-width: 100%;height: auto;display: inline;';
- } else {
- if (!style.includes('height')) {
- style += 'height: auto;';
- }
-
- if (!style.includes('display')) {
- style += 'display: inline;';
- }
-
- attrs['style'] = style;
- }
+ attrs['style'] = 'max-width:100%;height:auto;display:inline;';
return;
}
@@ -199,15 +186,15 @@ class HtmlInteraction {
// Add responsive defaults if missing
if (!style.includes('max-width')) {
- style += 'max-width: 100%;';
+ style += 'max-width:100%;';
}
if (!style.includes('height')) {
- style += 'height: auto;';
+ style += 'height:auto;';
}
if (!style.includes('display')) {
- style += 'display: inline;';
+ style += 'display:inline;';
}
attrs['style'] = style;
diff --git a/integration_test/scenarios/email_detailed/deformed_inlined_image_scenario.dart b/integration_test/scenarios/email_detailed/deformed_inlined_image_scenario.dart
index 4b0073823..2e25e7400 100644
--- a/integration_test/scenarios/email_detailed/deformed_inlined_image_scenario.dart
+++ b/integration_test/scenarios/email_detailed/deformed_inlined_image_scenario.dart
@@ -19,10 +19,20 @@ class DeformedInlinedImageScenario extends BaseTestScenario {
src="https://example.com/image.jpg"
alt="inline-image-no-style"/>
+
+
+ alt="inline-image-oversize-with-style-have-whitespaces"/>
+
+
+
+
+ alt="inline-image-oversize-with-style-and-width-attribute-have-whitespaces"/>
+
+
+
+
+ alt="inline-image-normal-size-with-style-and-width-attribute-have-whitespaces"/>
+
+
''';
@override
@@ -126,29 +164,34 @@ class DeformedInlinedImageScenario extends BaseTestScenario {
final imageList = List