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: Word-wrap text #8

Open
jscappini opened this issue Mar 26, 2017 · 8 comments
Open

Feature request: Word-wrap text #8

jscappini opened this issue Mar 26, 2017 · 8 comments
Assignees

Comments

@jscappini
Copy link

Hi!

I'm currently displaying a HighlightJsView inside a tabbed pane, and facing an issue of undesired interaction while side-scrolling long text: Swiping just go to the next tab. In spite of this, I would like to control how long text is displayed, being it word-wrapped or not.

Reading the WebView documentation, I found that I can control this behavior setting the LayoutAlgorithm flag to TEXT_AUTOSIZING, but applying that setting just change nothing in the final result. Intercepting the resulting HTML and then manually adding the word-wrap and white-space styles to the <pre> tag, I got what I want. My question is, can this be controlled with a setting or configuration flag of HighlightJsView?

Thanx!

@PDDStudio
Copy link
Owner

Hi @jscappini,
Thanks for pointing this out - I'll take a look at it and see whether I can include it as a config field.
I'm currently working on a rewrite of the library to allow more customization in general, if there's anything else you would like to see, let me know.

@jscappini
Copy link
Author

Hi @PDDStudio
Thanks for your response. By now this issue is holding me back to (more intensively) use your lib, but knowing that you're working on a rewrite is great. I'll try to squeeze it these days so I may give you better feedback. 😃
Keep the great work btw.

@PDDStudio
Copy link
Owner

Thanks @jscappini !
Whenever there's something that could improve the library's quality or feature-set feel free to either contribute by opening a pr or an issue for it 😉

@PDDStudio PDDStudio self-assigned this May 5, 2017
@k0shk0sh
Copy link

k0shk0sh commented Jun 19, 2017

@PDDStudio you could achieve that without breaking the line number with style:

 td.hljs-ln-code {
   word-wrap: break-word;
   word-break: break-all;
   white-space: pre-wrap;
 }

@PDDStudio
Copy link
Owner

@k0shk0sh thanks for pointing out!
I'll give this a try once I have finished rewriting the current library module.

@k0shk0sh
Copy link

Np mate, I changed to highlight.js in 3.0.0 for FastHub and realized that wrapping pre isn't the same for that lib so The only way was above mentioned without breaking the line number.b

Sent from my Htc m8 using FastHub

@mayankneeds
Copy link

Is this applied? How to use it now?

@uiuxarghya
Copy link

Is this applied? How to use it now?

pre {
  white-space: pre-wrap;
}

Just add these lines to your CSS file and it will work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants