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 don't align on word-wrapping lines #102

Closed
lightswitch05 opened this issue Dec 4, 2012 · 4 comments
Closed

Line numbers don't align on word-wrapping lines #102

lightswitch05 opened this issue Dec 4, 2012 · 4 comments
Milestone

Comments

@lightswitch05
Copy link

@lightswitch05 lightswitch05 commented Dec 4, 2012

When the code line is longer than the div's width, it has to line wrap. When using line numbers, this causes the numbers to become miss-aligned with the code lines. It also causes 2 digit line numbers to appear 1-digit per line.

Live Example

Original issue in Clipster

Screenshot line numbers

@nathany
Copy link
Contributor

@nathany nathany commented Dec 4, 2012

Perhaps try a overflow: auto CSS attribute to cause it to scroll instead of wrap?

From the way the code is breaking, I wonder if there is a word-wrap: break-word or word-break: break-all in the CSS somewhere? That probably isn't desirable.

@lightswitch05
Copy link
Author

@lightswitch05 lightswitch05 commented Dec 4, 2012

Thanks @nathany - turns out Bootstrap's CSS sets

word-break: break-all;
word-wrap: break-word;
white-space: pre-wrap;

on all <pre> elements

@korny
Copy link
Member

@korny korny commented Dec 5, 2012

Damn, that's unfortunate. Since Bootstrap is so popular, CodeRay's stylesheet should overwrite these values, just to be safe.

@korny korny reopened this Dec 5, 2012
@nathany
Copy link
Contributor

@nathany nathany commented Dec 5, 2012

It's actually part of normalize.css which a number of frameworks use:

pre {
  white-space: pre;
  white-space: pre-wrap;
  word-wrap: break-word;
}

Assuming CodeRay's CSS is loaded after, it could override this behavior.

@korny korny closed this in f46a737 Jun 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.