gpt4 book ai didi

html - GitHub Markdown 接受哪​​些内联 HTML 样式?

转载 作者:行者123 更新时间:2023-11-28 19:17:37 26 4
gpt4 key购买 nike

This给出了 HTML 元素如何被 Markdown 解释的非常详尽的描述。但它不讨论样式。

到目前为止,我唯一能做的就是图像宽度。

  1. 我在任何地方都找不到接受/呈现内容的列表
  2. 似乎完全忽略了 style="....." 属性。
  3. 我什至找不到老式样式属性的列表(相对于 样式属性 style=...)

https://gist.github.com/abalter/46df1b79e9f429342972477d7c20cebc


span 更改为 div,因为 div 根据@chris 的回答在@waylan 的评论中位于白名单标签中。

看来 Firefox 和 Chrome don't render any style attributes any more at all .

最佳答案

After GitHub converts Markdown 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.

你是对的:style 标签不在白名单中。他们被忽略了。

允许的属性因标签而异。我建议引用上面的清理过滤器链接。它会生成一个相当可读的 Ruby 源文件。

关于html - GitHub Markdown 接受哪​​些内联 HTML 样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57948600/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com