UNPKG
ha-chicken
Version:
latest (0.0.2)
0.0.2
0.0.1
An explanation of the interpreter of the programming language Chicken.
ha-chicken
/
lib
/
utils.js
11 lines
(9 loc)
•
245 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
function
parseHtmlEntities
(
str
) {
return
str.
replace
(
/&#([0-9]{1,3});/gi
,
function
(
match, numStr
) {
var
num =
parseInt
(numStr,
10
);
return
String
.
fromCharCode
(num); }); }
module
.
exports
= {
parseHtmlEntities
: parseHtmlEntities };