Lazy load math library
continuous-integration/drone/push Build is passing Details

single-block-api
Peter Stuifzand 3 years ago
parent 2a5d3f2498
commit f3737f96bd

@ -26,8 +26,7 @@ import formulaFunctions from './formula'
moment.locale('nl')
const math = create(all)
math.import(formulaFunctions)
let math;
function isMultiline(input) {
return input.value.startsWith("```", 0)
@ -181,8 +180,6 @@ function Editor(holder, input) {
}
function transformTable(editor, id, element) {
Promise.any()
editor.treeForId(id).then(tree => {
let header = _.find(tree[0].children, c => c.text === 'headers') || []
let rows = _.find(tree[0].children, c => c.text === 'rows') || []
@ -233,6 +230,11 @@ function Editor(holder, input) {
function transformMathExpression(converted, scope) {
try {
if (math === undefined) {
math = create(all)
math.import(formulaFunctions)
}
let expr = converted.substring(1);
let parsedExpr = math.parse(expr)
let compiled = parsedExpr.compile()

@ -357,7 +357,7 @@ function editor(root, inputData, options) {
moves: function (el, container, handle, sibling) {
return handle.classList.contains('marker')
}
});
})
let start = -1;
let startID = null;

Loading…
Cancel
Save