arnog / mathlive

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

Placeholder of the MATH-FIELD element and space character #2537

Closed truebluepl closed 2 weeks ago

truebluepl commented 1 month ago

Description

I would like to add space character into placeholder attribute of MATH-FIELD element, but space is ignored.

Steps to Reproduce

<math-field value="1" placeholder="some text"></math-field>

Actual Behavior

Placeholder is rendered as sometext. I was trying also "some\spacetext" and "some\spacetext", but with no luck (wrong parsing Latex).

Expected Behavior

Space should not be ingored.

arnog commented 2 weeks ago

The value of the placeholder text is a LaTeX string. To display it as text (including visible whitespace), use the \text command:

<math-field placeholder="\text{some text}"></math-field>