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 plugin adds extra line #403

Closed
hiulit opened this issue Nov 25, 2014 · 5 comments
Closed

Line Numbers plugin adds extra line #403

hiulit opened this issue Nov 25, 2014 · 5 comments

Comments

@hiulit
Copy link
Contributor

hiulit commented Nov 25, 2014

I don't know why it does that.

List of the plugins I'm using:

  • Line Numbers
  • Autolinker
  • WebPlatform Docs
  • File Highlight
  • Show Language

I tried to hack the code and removing the 1 + seems to work.

var linesNum = (1 + env.code.split('\n').length);
var linesNum = (env.code.split('\n').length);
@LeaVerou
Copy link
Member

Where is the extra line added? Do you have an online example demonstrating the issue?

@kuba-kubula
Copy link
Contributor

I guess this might happen if your <pre> block contains a trailing whitespace at the end of code, e.g.

<pre><code>some
lines
end
there

</code></pre>

Is that it?

Edit: And for Windows, there are \r\n related highlightable \r characters.

@hiulit
Copy link
Contributor Author

hiulit commented Nov 27, 2014

Yeah, that could be it @kuba-kubula now that you mention it.
Let me test it and I'll get back to both of you @LeaVerou

@haarg
Copy link

haarg commented Dec 14, 2014

#385 should fix this

@hiulit
Copy link
Contributor Author

hiulit commented Dec 15, 2014

Thanks!

@hiulit hiulit closed this as completed Dec 15, 2014
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

4 participants