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

Tables are not being rendered properly #907

Closed
nlowe opened this Issue Dec 2, 2014 · 24 comments

Comments

Projects
None yet
@nlowe
Contributor

nlowe commented Dec 2, 2014

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.

@tuftedocelot

This comment has been minimized.

Show comment
Hide comment
@tuftedocelot

tuftedocelot Dec 2, 2014

Contributor

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

Contributor

tuftedocelot commented Dec 2, 2014

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

@nlowe

This comment has been minimized.

Show comment
Hide comment
@nlowe

nlowe Dec 2, 2014

Contributor

Ah, I guess that makes sense. Thanks!
On Dec 2, 2014 9:09 AM, "tuftedocelot" notifications@github.com wrote:

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

[image: table]
https://cloud.githubusercontent.com/assets/1161222/5263748/57c391c6-79fa-11e4-91cf-b71c2dd936ac.png

For what it's worth, Atom uses a different library
https://github.com/atom/markdown-preview for its Markdown previewer


Reply to this email directly or view it on GitHub
#907 (comment).

Contributor

nlowe commented Dec 2, 2014

Ah, I guess that makes sense. Thanks!
On Dec 2, 2014 9:09 AM, "tuftedocelot" notifications@github.com wrote:

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

[image: table]
https://cloud.githubusercontent.com/assets/1161222/5263748/57c391c6-79fa-11e4-91cf-b71c2dd936ac.png

For what it's worth, Atom uses a different library
https://github.com/atom/markdown-preview for its Markdown previewer


Reply to this email directly or view it on GitHub
#907 (comment).

@VladUreche

This comment has been minimized.

Show comment
Hide comment
@VladUreche

VladUreche Jun 11, 2015

I'd like to open this again, for gollum 4.0.0 -- it's not even rendering the table above.

I mean this one:

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

Thx!

VladUreche commented Jun 11, 2015

I'd like to open this again, for gollum 4.0.0 -- it's not even rendering the table above.

I mean this one:

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

Thx!

@bartkamphorst

This comment has been minimized.

Show comment
Hide comment
@bartkamphorst

bartkamphorst Jun 11, 2015

Member

@VladUreche Which markdown gem do you have installed?

Member

bartkamphorst commented Jun 11, 2015

@VladUreche Which markdown gem do you have installed?

@VladUreche

This comment has been minimized.

Show comment
Hide comment
@VladUreche

VladUreche Jun 11, 2015

@bartkamphorst, thanks for the quick answer! This is what I get with --version:

$ gollum --version
Gollum 4.0.0

Is there a better way to check? (sorry, Ruby noob, I come from the JVM world)

VladUreche commented Jun 11, 2015

@bartkamphorst, thanks for the quick answer! This is what I get with --version:

$ gollum --version
Gollum 4.0.0

Is there a better way to check? (sorry, Ruby noob, I come from the JVM world)

@bartkamphorst

This comment has been minimized.

Show comment
Hide comment
@bartkamphorst

bartkamphorst Jun 12, 2015

Member

@VladUreche No worries, welcome to the Ruby community. 👍 Gollum depends on github-markup for rendering markups, which in turn uses kramdown as its default markdown renderer. If I do an out-of-the-box install of gollum with gem install gollum the example table renders just fine.
gollum_table
Which makes me wonder about your particular setup. Could you elaborate a bit, for example on how you installed gollum? Did you change any of the default settings? Is the page (with the table) that you are trying to render a markdown page?

Member

bartkamphorst commented Jun 12, 2015

@VladUreche No worries, welcome to the Ruby community. 👍 Gollum depends on github-markup for rendering markups, which in turn uses kramdown as its default markdown renderer. If I do an out-of-the-box install of gollum with gem install gollum the example table renders just fine.
gollum_table
Which makes me wonder about your particular setup. Could you elaborate a bit, for example on how you installed gollum? Did you change any of the default settings? Is the page (with the table) that you are trying to render a markdown page?

@dometto

This comment has been minimized.

Show comment
Hide comment
@dometto

dometto Jun 12, 2015

Member

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?).

Member

dometto commented Jun 12, 2015

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?).

@bartkamphorst

This comment has been minimized.

Show comment
Hide comment
@bartkamphorst

bartkamphorst Jun 12, 2015

Member

Strangely, yes, though I thought I used a clean gemset. Thanks @dometto , that clears some things up. @VladUreche I can reproduce the issue with just kramdown. Using github-markdown as @dometto suggested resolves the issue for me.

Member

bartkamphorst commented Jun 12, 2015

Strangely, yes, though I thought I used a clean gemset. Thanks @dometto , that clears some things up. @VladUreche I can reproduce the issue with just kramdown. Using github-markdown as @dometto suggested resolves the issue for me.

@VladUreche

This comment has been minimized.

Show comment
Hide comment
@VladUreche

VladUreche Jun 12, 2015

You could try doing gem install github-markdown and see if it renders correctly with that

Thanks a lot @dometto and @bartkamphorst, this solves my problem! What is strange is that my setup was quite close to a stock setup.

Which makes me wonder about your particular setup. Could you elaborate a bit, for example on how you installed gollum?

I ran into this problem on two machines:

  • my laptop running Ubuntu 14.04 with the following gems:
    • jekyll
    • bundler
    • github-pages
    • gollum
  • a virtual machine running Ubuntu 12.10, where I installed just gollum following the instructions on the wiki (it was a clean install, ruby was not present on the machine)

Did you change any of the default settings?

No changes, just git clone https://github.com/miniboxing/ildl-plugin.wiki.git && gollum.

Is the page (with the table) that you are trying to render a markdown page?

Yes, the page is taken from a github wiki: https://github.com/miniboxing/ildl-plugin/wiki/Sample-~-Data-Encoding

Thanks a lot for your kind help!

VladUreche commented Jun 12, 2015

You could try doing gem install github-markdown and see if it renders correctly with that

Thanks a lot @dometto and @bartkamphorst, this solves my problem! What is strange is that my setup was quite close to a stock setup.

Which makes me wonder about your particular setup. Could you elaborate a bit, for example on how you installed gollum?

I ran into this problem on two machines:

  • my laptop running Ubuntu 14.04 with the following gems:
    • jekyll
    • bundler
    • github-pages
    • gollum
  • a virtual machine running Ubuntu 12.10, where I installed just gollum following the instructions on the wiki (it was a clean install, ruby was not present on the machine)

Did you change any of the default settings?

No changes, just git clone https://github.com/miniboxing/ildl-plugin.wiki.git && gollum.

Is the page (with the table) that you are trying to render a markdown page?

Yes, the page is taken from a github wiki: https://github.com/miniboxing/ildl-plugin/wiki/Sample-~-Data-Encoding

Thanks a lot for your kind help!

@nlowe

This comment has been minimized.

Show comment
Hide comment
@nlowe

nlowe Jun 12, 2015

Contributor

Perhaps we could improve the --version switch to provide gem names and versions for certain gems where there are multiple available (eg: markdown renderer, syntax highlighter, etc.)?

Contributor

nlowe commented Jun 12, 2015

Perhaps we could improve the --version switch to provide gem names and versions for certain gems where there are multiple available (eg: markdown renderer, syntax highlighter, etc.)?

@dometto

This comment has been minimized.

Show comment
Hide comment
@dometto

dometto Jun 12, 2015

Member

@VladUreche: the 'stock' version of gollum comes with a markup renderer (kramdown) that's close to github-style markdown, but may deviate in certain cases (like this one). However, gollum is designed to use github-markdown (or various other markdown renderers) when present.

@techwiz24, that's a nice idea!

Member

dometto commented Jun 12, 2015

@VladUreche: the 'stock' version of gollum comes with a markup renderer (kramdown) that's close to github-style markdown, but may deviate in certain cases (like this one). However, gollum is designed to use github-markdown (or various other markdown renderers) when present.

@techwiz24, that's a nice idea!

@PaulMakepeace

This comment has been minimized.

Show comment
Hide comment
@PaulMakepeace

PaulMakepeace Sep 23, 2015

This may be related to redcarpet not rendering tables by default. github-markdown does though.

Worked for me (after require 'gollum/app'),

# "parse tables, PHP-Markdown style"
# https://github.com/vmg/redcarpet/tree/master#and-its-like-really-simple-to-use
module GitHub
  module Markup
    class Markdown < Implementation
      MARKDOWN_GEMS['redcarpet'] = proc do |content|
        Redcarpet::Markdown.new(Redcarpet::Render::HTML, tables: true).render(content)
      end
    end
  end
end

Created after reading https://github.com/github/markup/blob/master/lib/github/markup/markdown.rb#L10

PaulMakepeace commented Sep 23, 2015

This may be related to redcarpet not rendering tables by default. github-markdown does though.

Worked for me (after require 'gollum/app'),

# "parse tables, PHP-Markdown style"
# https://github.com/vmg/redcarpet/tree/master#and-its-like-really-simple-to-use
module GitHub
  module Markup
    class Markdown < Implementation
      MARKDOWN_GEMS['redcarpet'] = proc do |content|
        Redcarpet::Markdown.new(Redcarpet::Render::HTML, tables: true).render(content)
      end
    end
  end
end

Created after reading https://github.com/github/markup/blob/master/lib/github/markup/markdown.rb#L10

@arianf

This comment has been minimized.

Show comment
Hide comment
@arianf

arianf Sep 24, 2015

I just install a brand new fresh version of Gollum. I am not able to see tables.

screen shot 2015-09-24 at 3 27 26 pm

screen shot 2015-09-24 at 3 27 36 pm

gollum --version
Gollum 4.0.1

arianf commented Sep 24, 2015

I just install a brand new fresh version of Gollum. I am not able to see tables.

screen shot 2015-09-24 at 3 27 26 pm

screen shot 2015-09-24 at 3 27 36 pm

gollum --version
Gollum 4.0.1
@congaframe

This comment has been minimized.

Show comment
Hide comment
@congaframe

congaframe Nov 27, 2015

Hi,
I have similar issue. It renders fine in Preview Panel.
But not the front one.
I installed Gollum 4.0.1 as well as github-markdown (0.6.9)
|hostname|IP address|Comment|
|-----|-----|-----|
| | | |

Result:
|hostname|IP address|Comment| |-----|-----|-----| | | | |

congaframe commented Nov 27, 2015

Hi,
I have similar issue. It renders fine in Preview Panel.
But not the front one.
I installed Gollum 4.0.1 as well as github-markdown (0.6.9)
|hostname|IP address|Comment|
|-----|-----|-----|
| | | |

Result:
|hostname|IP address|Comment| |-----|-----|-----| | | | |

@zeigerpuppy

This comment has been minimized.

Show comment
Hide comment
@zeigerpuppy

zeigerpuppy Dec 7, 2015

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?

zeigerpuppy commented Dec 7, 2015

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?

@dometto

This comment has been minimized.

Show comment
Hide comment
@dometto

dometto Dec 15, 2015

Member

@zeigerpuppy you can use the --css option to inject custom css, but this option is not perfect: you need to commit the css file, and so it can be edited by wiki users.

Member

dometto commented Dec 15, 2015

@zeigerpuppy you can use the --css option to inject custom css, but this option is not perfect: you need to commit the css file, and so it can be edited by wiki users.

@dometto

This comment has been minimized.

Show comment
Hide comment
@dometto

dometto Mar 28, 2017

Member

@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
}
Member

dometto commented Mar 28, 2017

@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
}

@dometto dometto reopened this Mar 28, 2017

@dometto dometto closed this Mar 28, 2017

@bartkamphorst

This comment has been minimized.

Show comment
Hide comment
@bartkamphorst

bartkamphorst Mar 28, 2017

Member

The bigger question, I guess, is why are tables disabled by default?

Member

bartkamphorst commented Mar 28, 2017

The bigger question, I guess, is why are tables disabled by default?

@dometto

This comment has been minimized.

Show comment
Hide comment
@dometto

dometto Mar 28, 2017

Member

Basically to preserve old behavior when we moved from github-markdown to kramdown as default renderer. I suggest moving to default kramdown for 5.x.

Member

dometto commented Mar 28, 2017

Basically to preserve old behavior when we moved from github-markdown to kramdown as default renderer. I suggest moving to default kramdown for 5.x.

@bartkamphorst

This comment has been minimized.

Show comment
Hide comment
@bartkamphorst

bartkamphorst Mar 28, 2017

Member

👍 Maybe open an improvement issue for that?

Member

bartkamphorst commented Mar 28, 2017

👍 Maybe open an improvement issue for that?

@yellela

This comment has been minimized.

Show comment
Hide comment
@yellela

yellela Nov 12, 2017

A B C AA
Q W E RR

yellela commented Nov 12, 2017

A B C AA
Q W E RR
@matt-wallis

This comment has been minimized.

Show comment
Hide comment
@matt-wallis

matt-wallis Nov 17, 2017

After installing Gollum 4.1.2, the github-markdown gem was not installed. Here are the gems that were installed:

bombyx:~/.gem/ruby$ ls 2.4.0/gems/
charlock_holmes-0.7.5		gollum-grit_adapter-1.0.1	mustache-0.99.8			sanitize-2.1.0
diff-lcs-1.3			gollum-lib-4.2.7		nokogiri-1.8.1			sinatra-1.4.8
gemojione-3.3.0			kramdown-1.9.0			posix-spawn-0.3.13		stringex-2.7.1
github-markup-1.6.1		mime-types-3.1			rack-1.6.8			tilt-2.0.8
gitlab-grit-2.8.2		mime-types-data-3.2016.0521	rack-protection-1.5.3		useragent-0.16.8
gollum-4.1.2			mini_portile2-2.3.0		rouge-2.2.1

Manually installing github-markdown fixed the table problem. Does this point to an error in the dependencies for the gollum gem?

matt-wallis commented Nov 17, 2017

After installing Gollum 4.1.2, the github-markdown gem was not installed. Here are the gems that were installed:

bombyx:~/.gem/ruby$ ls 2.4.0/gems/
charlock_holmes-0.7.5		gollum-grit_adapter-1.0.1	mustache-0.99.8			sanitize-2.1.0
diff-lcs-1.3			gollum-lib-4.2.7		nokogiri-1.8.1			sinatra-1.4.8
gemojione-3.3.0			kramdown-1.9.0			posix-spawn-0.3.13		stringex-2.7.1
github-markup-1.6.1		mime-types-3.1			rack-1.6.8			tilt-2.0.8
gitlab-grit-2.8.2		mime-types-data-3.2016.0521	rack-protection-1.5.3		useragent-0.16.8
gollum-4.1.2			mini_portile2-2.3.0		rouge-2.2.1

Manually installing github-markdown fixed the table problem. Does this point to an error in the dependencies for the gollum gem?

@piprrr

This comment has been minimized.

Show comment
Hide comment
@piprrr

piprrr Jan 16, 2018

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.

piprrr commented Jan 16, 2018

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.

@bunnybooboo

This comment has been minimized.

Show comment
Hide comment
@bunnybooboo

bunnybooboo Jan 24, 2018

Try editing your wiki page again @piprrr I had the same issue on a fresh install. This fixed it for me.

bunnybooboo commented Jan 24, 2018

Try editing your wiki page again @piprrr I had the same issue on a fresh install. This fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment