Extension for Python-Markdown to handle <figure>
and <figcaption>
.
%%%
start a <figure>
%:
start a <figcaption>
from markdown import Markdown text = r''' %%% %%% figure-class here {: img-attributes here} %: figcaption here {: figcaption-attributes here} %: will not be a figcaption ''' md = Markdown(extensions=['markdown_figcap','attr_list']) print(md.convert(text))
Output:
<p>%%%</p> <figure class="figure-class here"> <img alt="img-alt" here="here" img-attributes="img-attributes" src="/source/of/img.jpg" /> <figcaption figcaption-attributes="figcaption-attributes" here="here">figcaption here</figcaption> </figure> <p>%: will not be a figcaption</p>
<figure>
's class) is supported by the origin Python-Markdown's attr_list
extension.<figure>
.figure
block.<p>
in <figure>
has no text and only one <img>
child, the <p>
tag will be got rid of.From PyPI:
pip install markdown-figcap
About
Extension for Python-Markdown to handle <figure> and <figcaption>.
Topics Resources License Stars Watchers ForksYou can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4