Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Fix math alignement ('&') when math contains non-ascii characters #150

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

arnaudgolfouse
Copy link
Contributor

So I noticed that alignment formatting in math mode sometimes gives strange result:

$
x & = y \
α & β
$
// becomes
$
  x  & = y \
  α & = β
$

It was due to usages of s.len(), which I replaced with s.chars().count().

Note that this does not attempt to handle unicode characters with weird widths, like

ABC
ABC

(Yes, it's real: those are U+FF21, U+FF22 and U+FF23, known as "fullwidth" ascii characters)

@astrale-sharp
Copy link
Owner

Amazing thanks :D

@astrale-sharp astrale-sharp merged commit 792880c into astrale-sharp:master Feb 10, 2024
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants