TF-3622 Synchronize all style attributes in html and write E2E for it.
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -119,7 +119,7 @@ class DownloadClient {
|
||||
fileName = fileName.split('.').first;
|
||||
}
|
||||
mimeType = HtmlUtils.validateHtmlImageResourceMimeType(mimeType);
|
||||
final base64Uri = '<img src="${HtmlUtils.convertBase64ToImageResourceData(base64Data: base64Data, mimeType: mimeType)}" alt="$fileName" style="max-width: $maxWidth;" data-mimetype="$mimeType" id="cid:$cid" />';
|
||||
final base64Uri = '<img src="${HtmlUtils.convertBase64ToImageResourceData(base64Data: base64Data, mimeType: mimeType)}" alt="$fileName" style="max-width:$maxWidth;" data-mimetype="$mimeType" id="cid:$cid" />';
|
||||
return base64Uri;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user