Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai(👎🏻🍜)
8 years ago
Commit
256c7d9d7ec392a51faa90a3c884096f9f48b6e9
1 parent
05f7fd2c
容错处理
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
utils/html-process.js
utils/html-process.js
View file @
256c7d9
...
...
@@ -18,7 +18,7 @@ const removeHtml = (str) => {
* [html转为转义]
*/
const
htmlToEscape
=
(
html
)
=>
{
return
html
.
replace
(
/
[
<>&"
]
/g
,
(
e
)
=>
{
return
(
html
||
''
)
.
replace
(
/
[
<>&"
]
/g
,
(
e
)
=>
{
return
_htmlMap
[
e
];
});
};
...
...
@@ -27,7 +27,7 @@ const htmlToEscape = (html) => {
* [转义符转为html]
*/
const
escapeToHtml
=
(
str
)
=>
{
return
str
.
replace
(
/&
(
lt|gt|nbsp|amp|quot
)
;/g
,
(
match
,
e
)
=>
{
return
(
str
||
''
)
.
replace
(
/&
(
lt|gt|nbsp|amp|quot
)
;/g
,
(
match
,
e
)
=>
{
return
_EscapeMap
[
e
];
});
};
...
...
Please
register
or
login
to post a comment