在 Markdown 中鼠标悬停时显示图像

Show image on mouseover in Markdown

我想知道是否可以在 tooltip/popover 香草或 GitHub 风味降价中显示链接图像。

我认为这有助于显示链接图像以简化降价长度。 Tappy 想到了。

约翰·格鲁伯的原创 Markdown

is two things: (1) a plain text formatting syntax; and (2) a software tool, written in Perl, that converts the plain text formatting to HTML.

它坚定地关注内容,而不是表现。

但是,它支持 inline HTML, so if you already have an image that you want to change and you're willing to write something like <img src="a.jpg" onmouseover="this.src='b.jpg'" onmouseout="this.src='a.jpg'" /> 你应该能够完成这项工作。

如果您想要不同的效果,您可以尝试使用内联 HTML 引入外部 CSS 或 JS。

GitHub 风味降价 is a different story。 HTML 由 Markdown 输入生成后

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.

此过程几乎肯定会删除您尝试的任何鼠标悬停技术。