Skip to content

Commit ed66619

Browse files
committed
Refactor to improve size by inlining module
1 parent 3a63c82 commit ed66619

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/util/safe.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module.exports = safe
22

3-
var encode = require('stringify-entities')
4-
53
var regexPunctuation = /[|\\{}()[\]^$+*?.-]/
64
var markdownPunctuation = /[!-/:-@[-`{-~]/
75

@@ -82,7 +80,9 @@ function safe(context, input, config) {
8280
result.push('\\')
8381
} else {
8482
// Character reference.
85-
result.push(encode(character, {subset: [character]}))
83+
result.push(
84+
'&#x' + value.charCodeAt(position).toString(16).toUpperCase() + ';'
85+
)
8686
start++
8787
}
8888
}

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"mdast-util-to-string": "^1.0.0",
4141
"parse-entities": "^2.0.0",
4242
"repeat-string": "^1.0.0",
43-
"stringify-entities": "^3.0.0",
4443
"zwitch": "^1.0.0"
4544
},
4645
"devDependencies": {

0 commit comments

Comments
 (0)