MCPcopy Create free account
hub / github.com/TruthHun/BookStack / scriptFromCodepoint

Function scriptFromCodepoint

static/katex/katex.js:678–692  ·  view source on GitHub ↗

* Given a codepoint, return the name of the script or script family * it is from, or null if it is not part of a known block

(codepoint)

Source from the content-addressed store, hash-verified

676 */
677
678function scriptFromCodepoint(codepoint) {
679 for (var i = 0; i < scriptData.length; i++) {
680 var script = scriptData[i];
681
682 for (var _i = 0; _i < script.blocks.length; _i++) {
683 var block = script.blocks[_i];
684
685 if (codepoint >= block[0] && codepoint <= block[1]) {
686 return script.name;
687 }
688 }
689 }
690
691 return null;
692}
693/**
694 * A flattened version of all the supported blocks in a single array.
695 * This is an optimization to make supportedCodepoint() fast.

Callers 1

SymbolNodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected