arnog / mathlive

A web component for easy math input
https://cortexjs.io/mathlive
MIT License
1.59k stars 280 forks source link

`convertAsciiMathToLatex` converting fractions only if the numerator is in brackets. #2530

Open stephtr opened 1 month ago

stephtr commented 1 month ago

Description

According to the docs, convertAsciiMathToLatex("1/2") should return"\frac{1}{2}". Currently, it only converts it to a frac if the numerator is in brackets, eg inputting"(1)/2"`.

Steps to Reproduce

(Required) Provide steps that are specific and repeatable

import { convertAsciiMathToLatex } from 'mathlive';
console.log(convertAsciiMathToLatex('1/2'));

Actual Behavior

Returns '1/2'.

Expected Behavior

image

Environment

MathLive version 0.101.0

Operating System macOS

Browser Edge