gollum: Tables are not being rendered properly

I just updated to 3.1 to see if that corrects the issue. It does not.

Given the following sample table

| P | Q | P * Q |
| - | - | - |
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |

Gollum renders it as one line, not as a table:

gollum-render

atom renders it like a table:

image

According to the GFM wiki, tables are supported.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 27 (13 by maintainers)

Commits related to this issue

Most upvoted comments

same issue here, fine in preview

  • fixed by re-running
gem install gollum
gem install github-markdown

Tables render in quite a narrow box leading to scrolling, however. is there a way to adjust the table width in the CSS?

gem install gollum should automatically install kramdown as markdown renderer. You could try doing gem install github-markdown and see if it renders correctly with that (@bartkamphorst, is it possible that you were accidentally using github-markdown in your test?).

It would appear that GFM requires a minimum of three hyphens before it’s interpreted as a table. Arbitrarily adding/removing spaces in the header/body makes no difference so long as three hyphens are present per column.

| P | Q | P * Q |
| - | - | - |
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |


|A|B|C|AA|
| --- | --- | --- | --- |
|Q|W   |    E | RR     |

table

For what it’s worth, Atom uses a different library for its Markdown previewer

Hello, I had the same problem with a table containing two hyphens | --|–|; after adding a hyphen |—|—|, the table rendered correctly.

I have the following versions: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu] gem 2.7.6 gollum (4.1.4) github-markdown (0.6.9) kramdown (1.9.0)

I can echo this problem still exists. I also installed github-markdown and it did not fix the problem.

$ ruby -v
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]

$ gem -v
2.6.14

$ which ruby gem
/Users/may/.rvm/rubies/ruby-2.4.2/bin/ruby
/Users/may/.rvm/rubies/ruby-2.4.2/bin/gem

$ gem list

*** LOCAL GEMS ***

bigdecimal (default: 1.3.0)
bundler-unload (1.0.2)
charlock_holmes (0.7.5)
did_you_mean (1.1.0)
diff-lcs (1.3)
executable-hooks (1.3.2)
gem-wrappers (1.3.2)
gemojione (3.3.0)
github-markdown (0.6.9)
github-markup (1.6.2)
gitlab-grit (2.8.2)
gitlab-markup (1.6.3)
gollum (4.1.2)
gollum-grit_adapter (1.0.1)
gollum-lib (4.2.7)
io-console (default: 0.4.6)
json (default: 2.0.4)
kramdown (1.9.0)
mime-types (3.1)
mime-types-data (3.2016.0521)
mini_portile2 (2.3.0)
minitest (5.10.1)
mustache (0.99.8)
net-telnet (0.1.1)
nokogiri (1.8.1)
openssl (default: 2.0.5)
posix-spawn (0.3.13)
power_assert (0.4.1)
psych (default: 2.2.2)
rack (1.6.8)
rack-protection (1.5.3)
rake (12.0.0)
rdoc (default: 5.0.0)
rouge (2.2.1)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
sanitize (2.1.0)
sinatra (1.4.8)
stringex (2.8.2)
test-unit (3.2.3)
tilt (2.0.8)
useragent (0.16.9)
xmlrpc (0.2.1)

And yet, when I load a *.md file with tables, the table is not rendered.

👍 Maybe open an improvement issue for that?

@lopopolo reports that the following snippet in config.rb can be used to activate tables even when using kramdown (so without github-markdown):

GitHub::Markup::Markdown::MARKDOWN_GEMS['kramdown'] = proc { |content|
  Kramdown::Document.new(content, :auto_ids => false).to_html
}