Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
pidan
/
FuSiLive
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
91a9e6e0
authored
Jun 20, 2024
by
pierce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加<fusi_del>html标签
parent
0b3bba66
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
FuSiLive/Classes/NewLive/Main/Other/FormatContent/FUSFormatContentHelper.m
FuSiLive/Classes/NewLive/Main/Other/FormatContent/FUSFormatContentHelper.m
View file @
91a9e6e0
...
...
@@ -343,19 +343,23 @@
return
content
;
}
//fusi_img:图片
//fusi_font:文字颜色
//fusi_del:删除标签
if
(
!
[
content
containsString
:
@"<img src=https://big.bgp.ourpow.com/comm/userlevel/v3"
]
&&
!
[
content
containsString
:
@"<fusi src=fusi://fusi.com?level="
]
&&
!
[
content
containsString
:
@"fusi_font"
])
{
&&
!
[
content
containsString
:
@"<fusi_img src=fusi://fusi.com?level="
]
&&
!
[
content
containsString
:
@"fusi_font"
]
&&
!
[
content
containsString
:
@"fusi_del"
])
{
return
content
;
}
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
;
// 正则搜索
NSRegularExpression
*
regularExpression
=
[
NSRegularExpression
regularExpressionWithPattern
:
regularStr
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment