Skip to content

Commit

Permalink
fix(mail): Fix HTML mail rendering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
WoodySlum committed Sep 4, 2024
1 parent 2dd1097 commit 41a0f8d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions UI/MailPartViewers/UIxMailPartHTMLViewer.m
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ - (void) _appendStyle: (unichar *) _chars
unichar *sanitizedChars, *start, *currentChar;
BOOL inComment;

if (rawContent)
return;

/**
* Sanitize style
* - remove control characters
Expand Down Expand Up @@ -341,10 +344,11 @@ - (void) _appendStyle: (unichar *) _chars
}
}
}
if (!inComment && currentChar > start)
if (!inComment && currentChar > start) {
if (*currentChar == '}' && *currentChar++ == '\000') currentChar++; // Add offset
[sanitizedStyle appendString: [NSString stringWithCharacters: start
length: (currentChar - start)]];

}
/**
* Parse sanitized style
* - remove at-rule definitions
Expand Down Expand Up @@ -384,8 +388,7 @@ - (void) _appendStyle: (unichar *) _chars
(*(currentChar-7) == 'p' || *(currentChar-7) == 'P') &&
(*(currentChar-8) == 'm' || *(currentChar-8) == 'M') &&
(*(currentChar-9) == 'i' || *(currentChar-9) == 'I') &&
*(currentChar-10) == '!')
&& !rawContent)
*(currentChar-10) == '!'))
{
length = (currentChar - start);
[declaration appendFormat: @"%@ !important;",
Expand Down

0 comments on commit 41a0f8d

Please sign in to comment.