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

Missing break opportunity before punctuation #26

Open
rvalery opened this issue Jul 1, 2022 · 0 comments
Open

Missing break opportunity before punctuation #26

rvalery opened this issue Jul 1, 2022 · 0 comments

Comments

@rvalery
Copy link

rvalery commented Jul 1, 2022

Hello,

I tested the library on a simple example. I have the text "Is this a test ?" (notice the space before question mark).
When displayed in a browser, it can break between "test" and "?".
But css-line-break does not treat the space between "test" and "?" as a break opportunity.

breaker = window['css-line-break'].LineBreaker("Is this a test ?", {lineBreak: 'normal', wordBreak: 'normal'});
while (!(bk = breaker.next()).done) { console.log(bk.value.slice()); }

gives 4 chunk of text :

Is
this
a
test ?

I have set these CSS rules on the div displaying the text :

	line-break: normal;
	word-break: normal;
	word-wrap: normal;

I expected the library to give me 5 chunks of text, separating the word "test" and the question mark. Is this something that I'm not doing correctly, or a bug in the library ?

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

1 participant