This commit is contained in:
11
node_modules/stringify-entities/lib/util/to-hexadecimal.js
generated
vendored
Normal file
11
node_modules/stringify-entities/lib/util/to-hexadecimal.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
module.exports = toHexReference
|
||||
|
||||
var fromCharCode = require('../constant/from-char-code')
|
||||
|
||||
// Transform `code` into a hexadecimal character reference.
|
||||
function toHexReference(code, next, omit) {
|
||||
var value = '&#x' + code.toString(16).toUpperCase()
|
||||
return omit && next && !/[\dA-Fa-f]/.test(fromCharCode(next))
|
||||
? value
|
||||
: value + ';'
|
||||
}
|
||||
Reference in New Issue
Block a user