mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-11 00:08:51 +00:00
fix(mail): remove negative margin from mail
This commit is contained in:
@@ -938,7 +938,11 @@ static NSString *_sanitizeHtmlForDisplay(NSString *content)
|
||||
|
||||
- (NSString *) cssContent
|
||||
{
|
||||
NSString *cssContent, *css;
|
||||
NSString *cssContent, *css, *newResult;
|
||||
NSRegularExpression *regex;
|
||||
NSError *error;
|
||||
|
||||
error = nil;
|
||||
|
||||
if (!handler)
|
||||
[self _parseContent];
|
||||
@@ -950,6 +954,11 @@ static NSString *_sanitizeHtmlForDisplay(NSString *content)
|
||||
[handler css]];
|
||||
else
|
||||
cssContent = @"";
|
||||
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"margin-(?:left|right)\\s*:\\s*-[^;]+(\\s*!important)?"
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:cssContent options:0 range:NSMakeRange(0, [cssContent length]) withTemplate:@"margin-left: 0 !important"];
|
||||
cssContent = [NSString stringWithString: newResult];
|
||||
|
||||
return cssContent;
|
||||
}
|
||||
@@ -1093,7 +1102,11 @@ static NSString *_sanitizeHtmlForDisplay(NSString *content)
|
||||
|
||||
- (NSString *) cssContent
|
||||
{
|
||||
NSString *cssContent, *css;
|
||||
NSString *cssContent, *css, *newResult;
|
||||
NSRegularExpression *regex;
|
||||
NSError *error;
|
||||
|
||||
error = nil;
|
||||
|
||||
if (!handler)
|
||||
[self _parseContent];
|
||||
@@ -1105,6 +1118,11 @@ static NSString *_sanitizeHtmlForDisplay(NSString *content)
|
||||
[handler css]];
|
||||
else
|
||||
cssContent = @"";
|
||||
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"margin-(?:left|right)\\s*:\\s*-[^;]+(\\s*!important)?"
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:cssContent options:0 range:NSMakeRange(0, [cssContent length]) withTemplate:@"margin-left: 0 !important"];
|
||||
cssContent = [NSString stringWithString: newResult];
|
||||
|
||||
return cssContent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user