在github的md文件中使用三个连字符创建表 [英] Using three hyphens in md files on github to create a table

查看:126
本文介绍了在github的md文件中使用三个连字符创建表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在使用一个Rmd文件,后来我使用knitr包将其转换为md文件. md文件(不是我的,只是一个例子)以

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

我不知道我的仓库为何或有什么不同.我注意到的是,如果在我的md文件中使用三个连字符换行而不使用任何代码块,那么我得到了所需的表.所以,某种程度上这样的代码块

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.

推荐答案

并不是github解析---作为表定界符,而是专门解析位于文件顶部的yaml元数据块(使用---作为分隔符)作为表格.

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.

有关公告,请参见此处.

这篇关于在github的md文件中使用三个连字符创建表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆