在Jekyll GitHub页面中使用Redcarpet时表不能渲染?

nei*_*zod 33 jekyll redcarpet github-pages

至于maruku引擎(默认),写表就像

surround text, etc.

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |

surround text...
Run Code Online (Sandbox Code Playgroud)

会正确呈现.

但是当我切换到redcarpet(添加markdown: redcarpet_config.yml)时,表不再呈现,包括localhost和GitHub页面.

我做错什么了吗?

nei*_*zod 64

markdown: redcarpet加入_config.yml是不够的,它还需要extensions部分,例如

markdown: redcarpet
redcarpet:
  extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]
Run Code Online (Sandbox Code Playgroud)

  • 请注意,这是"扩展"之前的空格而不是制表符 (2认同)

Ben*_*and 6

对于这个问题,似乎重要的扩展是"表格".

但是,如果你想要更多的Github风味降价,还有一些列在http://sholsinger.com/2014/03/jekyll-github-flavored-markdown.

结合neizod的答案我最终使用了.

markdown: redcarpet
redcarpet:
  extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "strikethrough", "superscript", "with_toc_data"]
Run Code Online (Sandbox Code Playgroud)