react-native-mathjax-html-to-svg
Version:
React Native component to display mathematics in html using MathJax. Uses [MathJax](https://github.com/mathjax/)
24 lines (23 loc) • 782 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.split = exports.isPercent = exports.unicodeChars = exports.quotePattern = exports.sortLength = void 0;
function sortLength(a, b) {
return a.length !== b.length ? b.length - a.length : a === b ? 0 : a < b ? -1 : 1;
}
exports.sortLength = sortLength;
function quotePattern(text) {
return text.replace(/([\^$(){}+*?\-|\[\]\:\\])/g, '\\$1');
}
exports.quotePattern = quotePattern;
function unicodeChars(text) {
return Array.from(text).map(function (c) { return c.codePointAt(0); });
}
exports.unicodeChars = unicodeChars;
function isPercent(x) {
return !!x.match(/%\s*$/);
}
exports.isPercent = isPercent;
function split(x) {
return x.trim().split(/\s+/);
}
exports.split = split;