arnog / mathlive

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

Repeating decimal and parenthesis #2384

Closed truebluepl closed 1 month ago

truebluepl commented 1 month ago

Description

In Polish language repeating decimal is presented as: a,(b)

Actual Behavior

Typing integer then decimal separator and decimal part with brackets, causes space between separator and left bracket.

Expected Behavior

There should not be space.

arnog commented 1 month ago

To get the proper spacing you must use MathfieldElement.decimalSeparator = ","

truebluepl commented 1 month ago

It works when I put number in format a,b (integer part, decimal separator and decimal fraction). But not when fraction is surrounded by brackets: a,(b)

arnog commented 1 month ago

This is what I get. Is this different than what you expect?

Screenshot 2024-05-23 at 7 09 27 AM
truebluepl commented 1 month ago

Here is my example:

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<script defer src="https://unpkg.com/mathlive"></script>
</head>
<body>
<math-field></math-field>
<script>
window.addEventListener('DOMContentLoaded', function() { 
  MathfieldElement.decimalSeparator = ",";
});
</script>
</body>
</html>

Still space after comma.

arnog commented 1 month ago

Ah, ok, this happens when using \left(...\right), not when using (...). OK, I could temporarily turn off smartfence when in this context.

arnog commented 1 month ago

Fixed with 0382ccd124b0ed1708b58498ca60eb1cec2be836