Github Markdown and colors

只谈情不闲聊 提交于 2019-12-08 13:29:05

问题


I have a table with the following code. The markdown viewer and on github pages the color is shown correct. But not on github.

|-   |-  |-   |-   |-   |
| <span style="font-family: Source Code Pro; padding: 20px; background-color: #000000; color: #fff;">#000000</span> |

The result on Github

The result on Github Pages

A table has the disadvantage that it does not move downwards at smaller screen sizes, but only to the right. How can I create a kind of grid layout


回答1:


Within GitHub, Markdown content is somewhat restricted. After Markdown is converted to HTML

The HTML is sanitized, aggressively removing things that could harm you and your kin—such as script tags, inline-styles, and class or id attributes. See the sanitization filter for the full whitelist.

(Bold added.)

The span tag is not included in the whitelist. Even if it was, the style attribute is also missing from the whitelist. The only way I know to achieve a visual similar to what's on GitHub Pages is to use an image, as you have done here.



来源:https://stackoverflow.com/questions/46211657/github-markdown-and-colors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!