Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong length for curly apostrophe #5

Closed
jgm opened this issue Oct 11, 2021 · 4 comments
Closed

Wrong length for curly apostrophe #5

jgm opened this issue Oct 11, 2021 · 4 comments

Comments

@jgm
Copy link
Owner

jgm commented Oct 11, 2021

Prelude Text.DocLayout Data.List> literal "a’s"
Text 2 "a\8217s"

Should be length 3. I found this after noting a bunch of wrapping-related test failures in pandoc from the new doclayout release.

@Xitian9 can you see the problem? I believe this is due to your changes in real length calculation code.

@jgm
Copy link
Owner Author

jgm commented Oct 11, 2021

Also with double quotes

Prelude Text.DocLayout Data.List> literal "a“b"
Text 2 "a\8220b"

@Xitian9
Copy link
Contributor

Xitian9 commented Oct 11, 2021

Let me look into it.

@Xitian9
Copy link
Contributor

Xitian9 commented Oct 11, 2021

Good catch. It looks like I mistyped the end of the ‘zero width joiners and directional markers’ block. which should be \x2010, not \x2030 (they are next to each other on my keyboard). I'll issue a fix.

@jgm jgm closed this as completed in 6fd791d Oct 12, 2021
@Xitian9
Copy link
Contributor

Xitian9 commented Oct 12, 2021

It would be good to come up with a more comprehensive test suite to be able to catch these things. There are a load of extra characters sprinkled throughout unicode that should be zero-width, and I certainly haven't gotten all of them.

Here's a place to start: https://en.wikipedia.org/wiki/Combining_character

Also, ambiguous characters technically should be either width 1 or 2 depending on what they're surrounded by…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants