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

typogrify: Do not remove space between a comma and a fraction #750

Merged
merged 2 commits into from
Sep 21, 2024

Conversation

gvtulder
Copy link
Contributor

Typogrify removes the space between a whole numbers and a fraction, but it currently also removes the space after a comma. Since the comment only mentions "whole numbers", the regexp probably shouldn't include commas.

@acabal
Copy link
Member

acabal commented Sep 20, 2024

The comma has to be there for cases like 1,234 ½ which have occurred before I believe. Can you address that?

@gvtulder
Copy link
Contributor Author

That's already covered. The regex only looks at the last digit, so in the case of 1,234 ½ it would match the 4 and remove the space. I could change it to ([0-9,]*[0-9]) if you want to capture all digits of 1,234, but that wouldn't change the output.

I've added your example to the test.

@acabal acabal merged commit 99f028a into standardebooks:master Sep 21, 2024
1 check passed
@acabal
Copy link
Member

acabal commented Sep 21, 2024

OK, thanks!

@gvtulder gvtulder deleted the f-typogrify branch September 23, 2024 22:13
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

Successfully merging this pull request may close these issues.

2 participants