问题
So I am working with an Rmd file which I later convert into and md file using the knitr
package. The md file(not mine, just an example) starts with
I am interested in how the text between the hyphens at the top is parsed. I want it to look like a table below,
but instead when I wrap the text with three hyphens in my repos I get what is highlighted in green
I have no idea why or what is different in my repo. What I did notice is that if use the three hyphens wrap without using any code chunks in my md file, then I get the desired table. So, somehow the code chunks like that
\```css
code chunk
\```
mess up the three hyphens wrap being parsed as a table. Any ideas of how to resolve this issue? Thanks.
回答1:
It's not that github is parsing ---
as a table delimiter, it is specifically parsing a yaml metadata block located at the top of the file (which uses ---
as it's delimiters) as a table.
See here for the announcement.
回答2:
If you want a table, make a table
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
Try not to make table with YAML Front Matter, that will end in tears.
来源:https://stackoverflow.com/questions/23774544/using-three-hyphens-in-md-files-on-github-to-create-a-table