@@ -240,6 +240,15 @@ - (void)testFontSizeInterpretation
240240 __block CGFloat paragraphFontSize = 0 ; // initialized from first font in paragraph
241241
242242 [output enumerateAttribute: (id )kCTFontAttributeName inRange: paragraphRange options: 0 usingBlock: ^(id value, NSRange range, BOOL *stop) {
243+
244+ NSString *subString = [[output string ] substringWithRange: range];
245+
246+ // the NL are exempt from the test
247+ if ([subString isEqualToString: @" \n " ])
248+ {
249+ return ;
250+ }
251+
243252 DTCoreTextFontDescriptor *fontDescriptor = [DTCoreTextFontDescriptor fontDescriptorForCTFont: (__bridge CTFontRef)(value)];
244253
245254 if (paragraphFontSize==0 )
@@ -300,7 +309,7 @@ - (void)testOrderedListStartingNumber
300309// testing if Helvetica font family returns the correct font
301310- (void )testHelveticaVariants
302311{
303- NSAttributedString *attributedString = [self _attributedStringFromHTMLString: @" <p style=\" font-family:Helvetica\" >Regular</p><p style=\" font-family:Helvetica\" ><b> Bold</b></ p><p style=\" font-family:Helvetica\" ><i> Italic</i></ p><p style=\" font-family:Helvetica\" ><b><i> Bold+Italic</i></b> </p>" ];
312+ NSAttributedString *attributedString = [self _attributedStringFromHTMLString: @" <p style=\" font-family:Helvetica\" >Regular</p><p style=\" font-family:Helvetica;font-weight:bold; \" >Bold</p><p style=\" font-family:Helvetica;font-style:italic;} \" >Italic</p><p style=\" font-family:Helvetica;font-style:italic;font-weight:bold;} \" >Bold+Italic</p>" ];
304313
305314 NSString *string = [attributedString string ];
306315 NSRange entireStringRange = NSMakeRange (0 , [string length ]);
@@ -363,6 +372,23 @@ - (void)testHeaderLevelTransfer
363372 STAssertEquals (level, (NSInteger )3 , @" Level should be 3" );
364373}
365374
375+ // Issue 437, strikethrough bleeding into NL
376+ - (void )testBleedingOutAttributes
377+ {
378+ NSAttributedString *attributedString = [self _attributedStringFromHTMLString: @" <p><del>abc<br/></del></p>" ];
379+
380+ STAssertTrue ([attributedString length ] == 5 , @" Attributed String should be 5 characters long" );
381+
382+ NSRange effectiveRange;
383+ NSNumber *strikethroughStyle = [attributedString attribute: DTStrikeOutAttribute atIndex: 0 effectiveRange: &effectiveRange];
384+
385+ STAssertNotNil (strikethroughStyle, @" There should be a strikethrough style" );
386+
387+ NSRange expectedRange = NSMakeRange (0 , 4 );
388+
389+ STAssertEquals (effectiveRange, expectedRange, @" Strikethrough style should only contain abc, not the NL" );
390+ }
391+
366392#pragma mark - Nested Lists
367393
368394- (void )testNestedListWithStyleNone
0 commit comments