-
Notifications
You must be signed in to change notification settings - Fork 360
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
Make slash non-breaking. #25
Comments
Thanks for the report. We do have a custom breaker wrapper so this should be possible. I'll look into it when I restart work on this project (hopefully soon). |
@Magotchi - I looked into this and it turns out the entire point of our custom breaker is to break on slashes! The use case for this is long URLs, rather than breaking at arbitrary points in the URL. Could you outline a little more the reason this is a problem? Thanks. |
In my opinion, it's a problem because:
I looked into the behavior of very large words (sequences of letters) that contain slashes:
|
… skip] See also implementation of line breaker using ICU4J in rtl-support module.
@Magotchi - Thanks for the detailed write-up. I've added a method to the builder to let the user specify a line breaker. For no-break on forward slashes you can use a default Java builder.useUnicodeLineBreaker(new FSTextBreaker() {
BreakIterator br = BreakIterator.getLineInstance(Locale.US);
@Override
public void setText(String newText) {
br.setText(newText);
}
@Override
public int next() {
return br.next();
}
}); If you are using the rtl module you can also use a builder.useUnicodeLineBreaker(new ICUBreakers.ICULineBreaker(Locale.CANADA)); However, the ICU line breaker breaks after forward slashes! Since ICU4J implements a more modern version of the Unicode standard, I suspect that some time in the future, the stock standard Java break iterator will do the same. |
In the following example, Firefox and Chromium refuse to break within any of the "test/test" sequences.
openhtmltopdf puts a break between "test" and "/test" (having the / on the next line), as shown here.
I believe it would be best if slash ("/") were considered to be a non-breaking character as other browsers seem to do.
The text was updated successfully, but these errors were encountered: