Skip to main content

Add <figcaption> elements to your images

Project description

# Image Captions and Python and Markdown, together!

Your images have `<figcaption>` elements attached.

[![PyPI version](](

Very similar to [figureAltCaption]( This version doesn' handle references or attributes, but does handle links inside the caption.

Behaviour is best displayed via the tests:

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

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


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

markdown-figure-caption-0.0.1.tar.gz (14.7 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page