Permalink
Browse files

Remove tags from user profile text. Fixes #38.

  • Loading branch information...
1 parent 856ce5f commit 36fef838847393dd0f9c6a6fdcbb3cd84c54bd8f @newsyc newsyc committed Apr 27, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 Classes/Controllers/ProfileController.m
@@ -13,6 +13,8 @@
#import "SubmissionListController.h"
#import "CommentListController.h"
+#import "NSString+Tags.h"
+
@implementation ProfileController
- (void)dealloc {
@@ -66,9 +68,9 @@ - (NSString *)aboutText {
NSString *about = [(HNUser *) source about];
about = [about stringByReplacingOccurrencesOfString:@"<p>" withString:@"\n\n"];
about = [about stringByReplacingOccurrencesOfString:@"<br>" withString:@"\n"];
- about = [about stringByReplacingOccurrencesOfString:@"<a href='" withString:@""];
- about = [about stringByReplacingOccurrencesOfString:@"'>" withString:@""];
- about = [about stringByReplacingOccurrencesOfString:@"</a>" withString:@""];
+ about = [about stringByReplacingOccurrencesOfString:@"<br />" withString:@"\n"];
+ about = [about stringByReplacingOccurrencesOfString:@"<br/>" withString:@"\n"];
+ about = [about stringByRemovingHTMLTags];
return about;
}

0 comments on commit 36fef83

Please sign in to comment.