mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-05 07:06:25 +00:00
Monotone-Parent: ab761b97d51a70312fa6548a0c618be9ab0a93e9
Monotone-Revision: ae0217b86030920b5df7ca27fd75ef3aaed08ade Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-02-26T16:37:59 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
BOOL inStyle;
|
||||
BOOL inScript;
|
||||
BOOL inCSSDeclaration;
|
||||
BOOL hasEmbeddedCSS;
|
||||
NSMutableArray *crumb;
|
||||
}
|
||||
|
||||
@@ -107,6 +108,7 @@
|
||||
inStyle = NO;
|
||||
inScript = NO;
|
||||
inCSSDeclaration = NO;
|
||||
hasEmbeddedCSS = NO;
|
||||
}
|
||||
|
||||
- (void) endDocument
|
||||
@@ -133,26 +135,6 @@
|
||||
showWhoWeAre();
|
||||
}
|
||||
|
||||
- (NSString *) _valueForCSSIdentifier: (NSString *) primaryValue
|
||||
{
|
||||
NSMutableString *value;
|
||||
NSEnumerator *classes;
|
||||
NSString *currentValue;
|
||||
|
||||
value = [NSMutableString new];
|
||||
[value autorelease];
|
||||
|
||||
classes = [[primaryValue componentsSeparatedByString: @" "] objectEnumerator];
|
||||
currentValue = [classes nextObject];
|
||||
while (currentValue)
|
||||
{
|
||||
[value appendFormat: @"SOGoHTMLMail-%@ ", currentValue];
|
||||
currentValue = [classes nextObject];
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
- (void) _appendStyle: (unichar *) _chars
|
||||
length: (int) _len
|
||||
{
|
||||
@@ -167,24 +149,35 @@
|
||||
if (inCSSDeclaration)
|
||||
{
|
||||
if (*(char *) currentChar == '}')
|
||||
inCSSDeclaration = NO;
|
||||
{
|
||||
inCSSDeclaration = NO;
|
||||
hasEmbeddedCSS = NO;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*(char *) currentChar == '{')
|
||||
inCSSDeclaration = YES;
|
||||
else if (*(char *) currentChar == '.'
|
||||
|| *(char *) currentChar == '#')
|
||||
if (*(char *) currentChar == ',')
|
||||
hasEmbeddedCSS = NO;
|
||||
else if (!hasEmbeddedCSS)
|
||||
{
|
||||
[css appendString: [NSString stringWithCharacters: start
|
||||
length: (currentChar - start + 1)]];
|
||||
[css appendString: @"SOGoHTMLMail-"];
|
||||
start = currentChar + 1;
|
||||
if (*(char *) currentChar == '@')
|
||||
hasEmbeddedCSS = YES;
|
||||
else
|
||||
if (*(char *) currentChar > 32)
|
||||
{
|
||||
[css appendString: [NSString stringWithCharacters: start
|
||||
length: (currentChar - start)]];
|
||||
[css appendString: @".SOGoHTMLMail-CSS-Delimiter "];
|
||||
hasEmbeddedCSS = YES;
|
||||
start = currentChar;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
[css appendString: [NSString stringWithCharacters: start
|
||||
length: (currentChar - start + 1)]];
|
||||
length: (currentChar - start)]];
|
||||
}
|
||||
|
||||
- (void) startElement: (NSString *) _localName
|
||||
@@ -215,10 +208,7 @@
|
||||
{
|
||||
skipAttribute = NO;
|
||||
name = [_attributes nameAtIndex: count];
|
||||
if ([name caseInsensitiveCompare: @"class"] == NSOrderedSame
|
||||
|| [name caseInsensitiveCompare: @"id"] == NSOrderedSame)
|
||||
value = [self _valueForCSSIdentifier: [_attributes valueAtIndex: count]];
|
||||
else if ([[name lowercaseString] hasPrefix: @"on"])
|
||||
if ([[name lowercaseString] hasPrefix: @"on"])
|
||||
skipAttribute = YES;
|
||||
else if ([name caseInsensitiveCompare: @"src"] == NSOrderedSame)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user