Handbook
Glossary
html-escape ( str -- newstr )
Vocabulary
html
.
entities
Inputs
str
a
string
Outputs
newstr
a
string
Word description
Replaces special characters
&
,
<
,
>
,
"
, and
'
to HTML-safe sequences.
Examples
USING: html.entities prettyprint ; "<foo>" html-escape .
"<foo>"
Definition
USING:
html.entities.private
kernel
make
math
sequences
;
IN:
html.entities
:
html-escape
( str -- newstr )
[
[
dup
next-escape
]
[
escape,
]
while*
drop
,
]
{
}
make
dup
length
1
>
[
concat
]
[
first
]
if
;