Changeset 3547

Show
Ignore:
Timestamp:
01/08/07 22:43:52 (2 years ago)
Author:
timothy
Message:

Strip illegal XML characters in initWithXHTMLFragment to prevent a libxml parse error.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Additions/NSAttributedStringMoreAdditions.m

    r3445 r3547  
    33// Copyright Graham Booker and Timothy Hatcher. All rights reserved. 
    44 
     5#import "NSAttributedStringMoreAdditions.h" 
     6 
    57#import <libxml/tree.h> 
    6 #import "NSAttributedStringMoreAdditions.h" 
     8#import <ChatCore/NSStringAdditions.h> 
    79 
    810static void setItalicOrObliqueFont( NSMutableDictionary *attrs ) { 
     
    290292 
    291293- (id) initWithXHTMLFragment:(NSString *) fragment baseURL:(NSURL *) base defaultAttributes:(NSDictionary *) attributes { 
    292         const char *string = [[NSString stringWithFormat:@"<root>%@</root>", fragment] UTF8String]; 
     294        const char *string = [[NSString stringWithFormat:@"<root>%@</root>", [fragment stringByStrippingIllegalXMLCharacters]] UTF8String]; 
    293295 
    294296        if( string ) {