Commit 9b5a4249 by ludi

Merge branch 'feature/UI修改版本' of http://git.yabolive.net:88/pidan/FuSiLive into feature/UI修改版本

parents 9b3f86d1 4b232366
...@@ -343,19 +343,23 @@ ...@@ -343,19 +343,23 @@
return content; return content;
} }
//fusi_img:图片
//fusi_font:文字颜色
//fusi_del:删除标签
if (![content containsString:@"<img src=https://big.bgp.ourpow.com/comm/userlevel/v3"] if (![content containsString:@"<img src=https://big.bgp.ourpow.com/comm/userlevel/v3"]
&& ![content containsString:@"<fusi src=fusi://fusi.com?level="] && ![content containsString:@"<fusi_img src=fusi://fusi.com?level="]
&& ![content containsString:@"fusi_font"]) { && ![content containsString:@"fusi_font"]
&& ![content containsString:@"fusi_del"]) {
return content; return content;
} }
content = [content stringByReplacingOccurrencesOfString:@"fusi_font" withString:@"font"]; content = [content stringByReplacingOccurrencesOfString:@"fusi_font" withString:@"font"];
content = [content stringByReplacingOccurrencesOfString:@"<img src=https://big.bgp.ourpow.com/comm/userlevel/v3" withString:@"<fusi src=fusi://hideImg"]; content = [content stringByReplacingOccurrencesOfString:@"<img src=https://big.bgp.ourpow.com/comm/userlevel/v3" withString:@"<fusi_img src=fusi://hideImg"];
if ([content containsString:@"<fusi src=fusi://fusi.com?level="]) { if ([content containsString:@"<fusi_img src=fusi://fusi.com?level="]) {
NSString *regularStr = @"<fusi src=fusi://fusi\\.com\\?level=([0-9]+) />"; NSString *regularStr = @"<fusi_img src=fusi://fusi\\.com\\?level=([0-9]+) />";
NSError *error; NSError *error;
// 正则搜索 // 正则搜索
NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:regularStr NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:regularStr
...@@ -381,6 +385,22 @@ ...@@ -381,6 +385,22 @@
} }
} }
if ([content containsString:@"fusi_del"]) {
NSString *regularStr = @"<fusi_del>(.*?)</fusi_del>";
NSError *error;
// 正则搜索
NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:regularStr
options:NSRegularExpressionCaseInsensitive
error:&error];
// 获取搜索结果数组
NSArray *matchArr = [regularExpression matchesInString:content options:NSMatchingReportProgress range:NSMakeRange(0, content.length)];
for (NSTextCheckingResult *result in matchArr) {
content = [content stringByReplacingCharactersInRange:result.range withString:@""];
}
}
return content; return content;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment