Giter Club home page Giter Club logo

caption's People

Contributors

flywire avatar sanzoghenzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

caption's Issues

Nested within link - ignored

The following URL is ignored:

[![Alt text](/path/to/image.png "This is the title of the image.")](URL)

Expected:

<figure>
<a href="URL">
<img alt="Alt text" src="/path/to/image.png" title="This is the title of the image."/>
</a>
<figcaption><span>Figure 1:</span> This is the title of the image.</figcaption>
</figure>

The link would include the image but not the caption.

The alt tag needs more consideration.

Appended style - stripped

The Attribute Lists extension is officially supported by Python-Markdown but the style is stripped.

Inline

To define attributes on inline elements, the attribute list should be defined immediately after the inline element with no white space.

[link](http://example.com){: class="foo bar" title="Some title!" }

The above results in the following output:

<p><a href="http://example.com" class="foo bar" title="Some title!">link</a></p>

e.g.:

![Alt text](/path/to/image.png "This is the title of the image."){: style="width:300px"}

Expected:

<figure>
<img alt="Alt text" src="/path/to/image.png" style="width:300px" title="This is the title of the image." />
<figcaption>This is the title of the image.</figcaption>
</figure>

Status of the project

Hi there,
first of all, thanks for this! After some research, I think this extension would be what I'm looking for, but I did encounter 2 issues for my use case (also found in yafg):

  • stripping the title results in a KeyError if no title is specified
  • if I don't strip the title, i got a "Figure 1: None" caption.

I would like to do a PR for this, but I was wondering what are your plans for this project...

  • do you intend to continue/resume the development or should I start a new, independent, fork?
  • which is the best branch/commit to continue your work? I see that ContentHack branch is ahead of the others, but I has many failing tests. Are they bugs to squash or there's some missing functionality still to implement?

Optional dependencies

Some of the requirements are optional. By moving them to extra's (e.g. pip install .[test]) most projects that have caption as dependency could be smaller:

In particular:

pytest
pytest-cov
coverage

Captions for Tables

The caption Tag is used to specify the caption of a table. This tag will be inserted just after the <table> tag.

Markdown does not define a caption for tables. This could be done by convention, alternatively using an Officially Supported Extension, as shown below, before rendering.

Table Example with heading, two columns and a row

| Syntax      | Description |
| ----------- | ----------- |
| Header      | Title       |
| Paragraph   | Text        |
<p>Table Example with heading, two columns and a row</p>
<table>
<thead>
<tr>
<th>Syntax</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Header</td>
<td>Title</td>
</tr>
<tr>
<td>Paragraph</td>
<td>Text</td>
</tr>
</tbody>
</table>

Output

Table Example with heading, two columns and a row

Syntax Description
Header Title
Paragraph Text

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.