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 Highlights Size #1036

Closed
duplaja opened this issue Oct 18, 2016 · 4 comments
Closed

Line Highlights Size #1036

duplaja opened this issue Oct 18, 2016 · 4 comments

Comments

@duplaja
Copy link

duplaja commented Oct 18, 2016

Is there a reason that the div used for line-highlights does not auto-size to the same as the code block?

I added this in (minified version), to let it do that: h.style.width=e.firstChild.offsetWidth+60+'px',

Otherwise, on long lines, you can scroll and then highlight stops at the width of the pre tag. You can see this behavior on the examples on PrismJS.com

@jarodium
Copy link

If is this you are refering to, then I got the same issue.
This was the result after I linked with #id-div.2-5

Also, I'm not sure if this helps, but I am using the code highlighter inside a second level tabbed page on bootstrap, which is not loaded at page loading. Basically I load the code highlighter after a ajax request.

captura de ecra 2017-01-28 as 16 02 45

@chenningg
Copy link

Still having this issue. Is there a fix for the unminified javascript?

@chenningg
Copy link

Fixed using this line:

// Make line stretch to whole width
line.style.width = pre.scrollWidth + "px";

@RunDevelopment
Copy link
Member

I think this issue is fixed by #3011.

Feel free to comment on this issue and request reopening if it wasn't fixed.

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