Search code examples
githubjekyllgithub-pages

GitHub Pages code highlighter adds extra space


I use GitHub pages to host a website. Everything works fine except syntax highlighter. It adds extra empty line if Java code line starts with // and does not update line numbers. When I run the same site locally everything is works fine. Here is an example.

Wrong

As you can see it added an empty line after // comment.

Godd

And if run locally everything is ok.

My _config.yml


gems:
  - jekyll-paginate
  - jekyll-sitemap # add /sitemap.xml file

paginate_path: /_pages/page:num

highlighter: rouge
markdown: kramdown
kramdown:
  input: GFM

Hosted website

Github pages

How can I sort this problem?


Solution

  • This is a line ending problem. You have to change CRLF to LF.

    Configure your code editor to use LF. If you can't, change editor.