File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Open diff view settings
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Open diff view settings
Original file line number Diff line number Diff line change @@ -32,9 +32,15 @@ - (instancetype)initWithString:(NSString *)htmlString showType:(MediaShowType)sh
3232- (void )analyseHtmlElement : (TFHppleElement* )element withShowType : (MediaShowType)showType {
3333 HtmlMediaItem *item = nil ;
3434 if (element.isTextNode ) {
35- if ([element.content stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet ]].length > 0
36- || (![_contentDisplay hasSuffix: @" \n " ] && _contentDisplay.length > 0 )) {
35+ if ([element.content stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet ]].length > 0 ) {
3736 [_contentDisplay appendString: element.content];
37+ }else if (![_contentDisplay hasSuffix: @" \n " ] && _contentDisplay.length > 0 ){
38+ NSCharacterSet *lineSet = [NSCharacterSet newlineCharacterSet ];
39+ if ([element.content rangeOfCharacterFromSet: lineSet].location != NSNotFound ) {
40+ [_contentDisplay appendString: @" \n " ];
41+ }else {
42+ [_contentDisplay appendString: element.content];
43+ }
3844 }
3945 }else if ([element.tagName isEqualToString: @" br" ]){
4046 if (![_contentDisplay hasSuffix: @" \n " ] && _contentDisplay.length > 0 ) {
You can’t perform that action at this time.
0 commit comments