跳转到主要内容

向您的图像添加<figcaption>元素

项目描述

# 图像标题和Python以及Markdown,一起!

您的图像附加了`<figcaption>`元素。

[![travis](https://travis-ci.org/bcaller/markdown_figure_caption.svg)](https://travis-ci.org/bcaller/markdown_figure_caption)
[![PyPI版本](https://badge.fury.io/py/markdown_figure_caption.svg)](https://badge.fury.io/py/markdown_figure_caption)

与[figureAltCaption](https://github.com/jdittrich/figureAltCaption)非常相似。这个版本不处理引用或属性,但可以处理标题内的链接。

行为最好通过测试来展示

```python
def test_image_simple(markdown)
s = "![The caption](http://example.com/x.png)"
converted = markdown.convert(s)
assert converted == '<p><figure><img alt="The caption" src="http://example.com/x.png" /><figcaption>The caption</figcaption></figure></p>'


def test_image_link_in_caption(markdown)
s = "![The caption from [source](http://example.com)](http://example.com/x.png)"
converted = markdown.convert(s)
assert converted == '<p><figure><img alt="The caption from source" src="http://example.com/x.png" /><figcaption>The caption from <a href="http://example.com">source</a></figcaption></figure></p>'

```


项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分发

markdown-figure-caption-0.0.1.tar.gz (14.7 kB 查看哈希值)

上传时间 源代码

构建分发

markdown_figure_caption-0.0.1-py3-none-any.whl (4.1 kB 查看哈希值)

上传时间 Python 3

由以下支持