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
Fix hyphen duplication rule for some languages #4058
Conversation
efc1a39
to
946d8b6
Compare
ae55845
to
257b556
Compare
257b556
to
5b01789
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial observations:
5b01789
to
73a83aa
Compare
73a83aa
to
3867439
Compare
if prepend_hyphen && before.is_empty() { | ||
reshaped.prepend_hyphen(engine, p.fallback); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too fond of the duplication in doing it potentially in this branch (for the last item) and then again in the later branch (for the first item, if first != last). Maybe we could just do it at the end, similarly to maybe_adjust_first_glyph
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created a do_prepend_hyphen
variable. So I can reuse it on both places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant was more to have the prepend_hyphen
itself just a single time right before if maybe_adjust_first_glyph {
with a construction similar to the first.as_mut().or(last.as_mut())
used there. Do you think that'd be possible and make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I got it now.
3d27b49
to
bb68389
Compare
bb68389
to
802f6f2
Compare
- Czech - Croatian - Lower Sorbian - Polish - Portuguese - Slovak - Spanish Fix typst#3235
802f6f2
to
66cf0fd
Compare
Thank you! |
This pr closes #3235.
Implement hyphen duplication rule for Czech, Croatian, Lower Sorbian, Polish, Portuguese, Slovak and Spanish.
So the input
generates
Tasks
should_repeat_hyphen()
function.