python标记处理<figure>和<figcaption>的扩展。

markdown-figcap的Python项目详细描述


降价图

用于Python-Markdown处理<figure><figcaption>的扩展。

用法

  • %%%开始一个<figure>
  • %:启动一个<figcaption>
frommarkdownimportMarkdowntext=r'''%%%%%% figure-class here    ![img-alt](/source/of/img.jpg){: img-attributes here}    %: figcaption here    {: figcaption-attributes here}%: will not be a figcaption'''md=Markdown(extensions=['markdown_figcap','attr_list'])print(md.convert(text))

输出:

<p>%%%</p><figureclass="figure-class here"><imgalt="img-alt"here="here"img-attributes="img-attributes"src="/source/of/img.jpg"/><figcaptionfigcaption-attributes="figcaption-attributes"here="here">figcaption here</figcaption></figure><p>%: will not be a figcaption</p>

注意

  • Python-Markdown^{}扩展支持属性呈现(除了<figure>的类)。
  • 图starter only不会呈现为<figure>
  • figcaption starter只有在figure块中才能生效。
  • 如果<figure>中的<p>没有文本并且只有一个子项,则<img>标记将被删除。

安装

来自PyPI

pip install markdown-figcap

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java网络视图。loadData不适用于Android 9.0(API29)   安卓“ArrayAdapter要求资源ID为TextView”XML问题   Java压缩文件:有限制吗?   java如何在recyclerview中单击项时显示对话框   TextField中的if语句值抛出java。lang.NumberFormatException错误   java文件通过服务器ip上传,但不从域名上传   java HttpRequestBase如何打印请求及其所有数据   java如何实现JPanel的等宽等高   java为Struts 2动态填充jqGrid select   用于替换xml字符串中的字符串的正则表达式   如何防止Java代码中的整数溢出?   java如何在SpringBoot 2中禁用安全性?   java出现读入文件问题,并将其设置为变量