问题描述
我有这些选项来配置我的 marked
对象,但表格没有使用正确的 css 呈现。
{
gfm: true,tables: true,breaks: false,pedantic: false,sanitize: false,smartLists: true,xhtml: false,smartypants: true,langPrefix: 'hljs language-',highlight(code) {
return hljs.highlightAuto(code,['html','javascript','java']).value;
},}
有什么我遗漏的吗?
是否有一个 min.css
文件需要包含在 index.html
中才能完成这项工作并为表格提供适当的 css?
表格呈现如下:
对应的markdown是:
| ID | Name| email |
|:----:|:----:|:----:|
| ... | ... | ... |
| ... | ... | ... |
| ... | ... | ... |
解决方法
加入gfm.min.css
后问题解决了
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/pixelbrackets/gfm-stylesheet/dist/gfm.min.css" />