function eqToHTML(equation) { equation = equation.slice(2, -2) .replaceAll(/ /g, '') .replaceAll(/[\/+\*-=:]/g, '$&') .replaceAll(/\\frac{(.*)}{(.*)}/g, '$1$2') .replaceAll(/\^{(.*)}/g, '$1'); equation = equation .replaceAll(/\\frac{(.*)}{(.*)}/g, '$1$2') .replaceAll(/\^{(.*)}/g, '$1'); return '