Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F8929431
html.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
659 B
Referenced Files
None
Subscribers
None
html.js
View Options
"use strict"
;
const
sanitizeHtml
=
require
(
"sanitize-html"
);
module
.
exports
=
{
name
:
"html"
,
extends
:
"text"
,
encode
:
function
(
context
,
params
,
value
){
return
{
original
:
value
,
safe
:
sanitizeHtml
(
value
,
{
allowedTags
:
sanitizeHtml
.
defaults
.
allowedTags
.
concat
([
"img"
,
"h1"
,
"h2"
])
}),
};
},
format
:
function
(
context
,
params
,
decoded_value
,
format
){
let
ret
;
if
(
decoded_value
===
undefined
)
return
undefined
;
switch
(
format
){
case
"unsafe"
:
ret
=
decoded_value
.
original
;
break
;
case
"original"
:
ret
=
decoded_value
.
original
;
break
;
default
:
ret
=
decoded_value
.
safe
;
break
;
}
return
ret
;
}
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 20, 22:48 (22 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
943035
Default Alt Text
html.js (659 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment