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

Feature request: Support CSS word-break: break-all #117

Open
tig opened this issue Dec 27, 2019 · 1 comment
Open

Feature request: Support CSS word-break: break-all #117

tig opened this issue Dec 27, 2019 · 1 comment

Comments

@tig
Copy link
Contributor

tig commented Dec 27, 2019

My app prints source code. Uses prismjs to do syntax highlighting. Example source code:

image

With litehtml now, using only white-space: pre-wrap this code looks like shit:

image
(because lines that are too long that don't have whitespace in them don't wrap, but clip)

I need lines that are too long to wrap at any character, not just whitespace. This is what word-break is for.

image

image

Relevant codepen: https://codepen.io/t_i_g/pen/xxGbgxz

@tig
Copy link
Contributor Author

tig commented Feb 7, 2020

Some notes as I research how to fix this....

litetml only supports white-space: pre-wrap. word-break: break-all are not yet supported.

/* Relevant docs:
    white-space - https://developer.mozilla.org/en-US/docs/web/css/white-space 
    word-break - https://developer.mozilla.org/en-US/docs/Web/CSS/word-break 
    overflow-wrap - https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap 

    Default for winprint should be `word-break: break-all` 
    Ideally would also support `overflow-wrap: break-word`
*/
white-space: pre-wrap; /* not good enuf. does not break at non-whitespace chars*/
overflow-wrap: break-word; /* would work well, except broken line will start on a new line (suboptimal) */
word-break: break-word; /* ok - may be a preference (breaks at word, then breaks-all) */
word-break: break-all; /* ideal - breaks anywhere */

I can't find in source where litehtml is actually doing the work of supporting white-space.

Looking for where support for word-break might be implemented.

@tig tig changed the title Feature request: CSS word-wrap: break-word and/or word-break: break-all and/or Feature request: Support CSS word-break: break-all Feb 7, 2020
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