gollum: Mistreatment of line breaks in 5.x

Consider the following contents of an .md file:

foo
bar

On 4.x it renders correctly as a single paragraph of text:

<p>foo bar</p>

However, 5.x inserts a line break after “foo”:

<p>foo <br />
bar</p>

which is against Markdown specification.

On the 4.x branch I am using github-markdown gem for rendering (installed with sudo gem install github-markdown). I honestly don’t know whether that gem is also being used when I run gollum 5.x from a local copy of a repository. I start gollum 5.x by running the following command from gollum repo directory:

bundle exec bin/gollum --css --mathjax --h1-title --port 1234 --config /path/to/config.rb /path/to/wiki/repo

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (14 by maintainers)

Most upvoted comments

This may be due to a recent issue with nokogiri, or rather the combination of the most recent version of nokogiri (v1.14.0) and gollum. This issue is fixed on gollum master, but since I believe @aka13-404 is using the JAR release of gollum v5.3.0, that would still be affected. Sorry about that! Think the best thing to do is to wait for gollum 6.0 to come out, which we hope to do take care of soon.

Thanks. So you’re rendering Markdown with kramdown, not github-markdown. To use github-markdown, add github-markdown to your Gemfile in the local copy of 5.x and run bundle install. If you then run bundle exec bin/gollum --versions again, you should see github-markdown listed as your Markdown rendering gem.

To the issue at hand: it looks like this is not an issue with gollum, but with Kramdown:

$> Kramdown::Document.new("foo\nbar").to_html
 => "<p>foo\nbar</p>\n"