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

line numbers positioned wrong in Safari #31

Open
Haroenv opened this issue Jan 3, 2018 · 6 comments
Open

line numbers positioned wrong in Safari #31

Haroenv opened this issue Jan 3, 2018 · 6 comments
Assignees
Labels

Comments

@Haroenv
Copy link

Haroenv commented Jan 3, 2018

screen shot 2018-01-03 at 15 02 17

line numbers are smaller than the lines itself. Would maybe be interesting to put them into the same line as the line of code itself to make it simpler.

It looks correct in Chrome.

@brunosimon brunosimon added the bug label Jan 9, 2018
@brunosimon brunosimon self-assigned this Jan 9, 2018
@brunosimon
Copy link
Owner

Thanks for the report @Haroenv.

I can't reproduce the bug. What is your safari version? Are you using it on a Mac or a PC?
The line-height is set directly on the parent div .viewer which include both the code and the lines.

Are you sure the problem come from the line-height? Maybe the lines you see are those from another file or the last ones are missing.

@Haroenv
Copy link
Author

Haroenv commented Jan 10, 2018

I found what the issue is: if a line wraps, the line numbers continue, while they should break like an editor does.

screen shot 2018-01-10 at 14 34 38

screen shot 2018-01-10 at 14 34 44

This is tested on Safari on Mac

In Chrome there's no line wrapping

@brunosimon
Copy link
Owner

Ok I see it.
I'll fix it soon and I'll tell you :)

@brunosimon
Copy link
Owner

It seems that the problem come from Safari which doesn't recognize white-space: pre;

I'm using Highlight.js for the syntax coloration with vue-highlightjs. The library isn't very flexible and even if I could add one of the line numbers plugins, those are very poorly made and probably won't work in Keppler case.

I tried to add white-space: nowrap; in CSS but all the code get transform into one line.

If anyone has any suggestion that might help

@Haroenv
Copy link
Author

Haroenv commented Jan 11, 2018

Did you try a pure css solution with counters on every line of code? That way it should stay synchronised with the lines I think https://www.sylvaindurand.org/using-css-to-add-line-numbering/

@brunosimon
Copy link
Owner

brunosimon commented Jan 11, 2018

Yes but there is two problems:

  • There is no way to select each line in CSS
  • Those lines number has vue.js interactions

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

No branches or pull requests

2 participants