MCPcopy Index your code
hub / github.com/markdown-it/markdown-it / isValidEntityCode

Function isValidEntityCode

lib/common/utils.mjs:44–58  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

42}
43
44function isValidEntityCode (c) {
45 // broken sequence
46 if (c >= 0xD800 && c <= 0xDFFF) { return false }
47 // never used
48 if (c >= 0xFDD0 && c <= 0xFDEF) { return false }
49 if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false }
50 // control codes
51 if (c >= 0x00 && c <= 0x08) { return false }
52 if (c === 0x0B) { return false }
53 if (c >= 0x0E && c <= 0x1F) { return false }
54 if (c >= 0x7F && c <= 0x9F) { return false }
55 // out of range
56 if (c > 0x10FFFF) { return false }
57 return true
58}
59
60function fromCodePoint (c) {
61 /* eslint no-bitwise:0 */

Callers 3

entityFunction · 0.90
replaceEntityPatternFunction · 0.85
utils.test.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…