| | 1653 | } |
|---|
| | 1654 | } |
|---|
| | 1655 | } |
|---|
| | 1656 | |
|---|
| | 1657 | attributeRange = [style rangeOfString:@"font-style: " options:NSCaseInsensitiveSearch]; |
|---|
| | 1658 | if (attributeRange.location != NSNotFound) { |
|---|
| | 1659 | NSRange nextSemicolon = [style rangeOfString:@";" |
|---|
| | 1660 | options:NSLiteralSearch |
|---|
| | 1661 | range:NSMakeRange(attributeRange.location, styleLength - attributeRange.location)]; |
|---|
| | 1662 | if (nextSemicolon.location != NSNotFound) { |
|---|
| | 1663 | NSString *fontStyle = [style substringWithRange:NSMakeRange(NSMaxRange(attributeRange), nextSemicolon.location - NSMaxRange(attributeRange))]; |
|---|
| | 1664 | [originalAttributes setObject:[NSNumber numberWithUnsignedInt:[textAttributes traits]] |
|---|
| | 1665 | forKey:@"setTraits:"]; |
|---|
| | 1666 | if (([fontStyle caseInsensitiveCompare:@"italic"] == NSOrderedSame) || |
|---|
| | 1667 | ([fontStyle caseInsensitiveCompare:@"oblique"] == NSOrderedSame)) { |
|---|
| | 1668 | [textAttributes enableTrait:NSItalicFontMask]; |
|---|
| | 1669 | } else { |
|---|
| | 1670 | [textAttributes disableTrait:NSItalicFontMask]; |
|---|