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

Github Flavoured Markdown table support #269

Closed
jaykilleen opened this issue Jan 16, 2017 · 2 comments
Closed

Github Flavoured Markdown table support #269

jaykilleen opened this issue Jan 16, 2017 · 2 comments

Comments

@jaykilleen
Copy link

jaykilleen commented Jan 16, 2017

Sorry if I am missing something obvious here but I have tried implementing the GFM syntax for tables into one of my projects.

I have set gfm => true in my application helper and am able to successfully render code blocks, emojis, links and other functionality.

  def markdownify(content)
    pipeline_context = {gfm: true, asset_root: "https://a248.e.akamai.net/assets.github.com/images/icons/"}
    pipeline = HTML::Pipeline.new [
        HTML::Pipeline::MarkdownFilter,
        HTML::Pipeline::EmojiFilter,
        HTML::Pipeline::SanitizationFilter
        ], pipeline_context
        pipeline.call(content)[:output].to_s.html_safe
  end

Is there something else I need to have this functionality?

@amitpatra
Copy link

Try to add :commonmarker_extensions => [ :table].

@gjtorikian
Copy link
Owner

Yes, we ought to do a better job documenting here, but @amitpatra is correct (based on https://github.com/jch/html-pipeline/blob/010a6bdeace506725d619b95812eb6c4c55ca4c0/lib/html/pipeline/markdown_filter.rb#L11) and you can pass any of the Commonmarker extensions through.

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

3 participants