markdig icon indicating copy to clipboard operation
markdig copied to clipboard

Add support for implicit figures for images

Open RickStrahl opened this issue 8 years ago • 3 comments

I'm using builder.UseFigures() in my pipeline builder code, but I don't see figure output rendered.

Example here: https://babelmark.github.io/?text=!%5BSave+Image+to+Azure+Blob+Storage+Addin%5D(https%3A%2F%2Fgithub.com%2FRickStrahl%2FSaveToAzureBlob-MarkdownMonster-Addin%2Fraw%2Fmaster%2FSaveToAzureMarkdownMonsterAddin.gif)%0A

Markdig renders the image only which seems like Figures is not doing anything. Pandoc renders with figure classes, multi-markdown uses figure proper figure/figcaption elements.

Looks like MarkDig should render figure/figurecaption, but I don't see it rendered. Double checked to make sure FigureExtension is loaded in the final PipelineBuilder used to render with:

Markdown.Convert(markdown, renderer, Pipeline);

BTW, how does the Markdig Parser run in BabelMark? With all options enabled?

RickStrahl avatar Mar 14 '17 22:03 RickStrahl

Afair, The figure extension is not doing anything with regular image links. As described on CommonMark forum, I implemented the following:

^^^
This is a text
> With a block quote and an ![image](/url "my title")
^^^ My caption

The ^^^ identifies a figure block with a block caption and renders like this:

<figure>
  <p>This is a text</p>
  <blockquote><p>With a block quote and an <img src="/url" alt="image" title="my title"><p>
  </blockquote>
  <figcaption>My caption</figcaption>
</figure>

In this discussion, they talked about implementing something automatically for img, but It was not settled and I prefer to have an explicit figure caption (and not automatically generated)

^^^
![Kookburra](/kookaburra.jpg "Kookburra")
![Pelican](/pelican.jpg "Pelican")
![Cheeky looking Rainbow Lorikeet](/lorikeet.jpg "Rainbow Lorikeet")
^^^ From left to right, Kookburra, Pelican, and Rainbow Lorikeet.

should render like this (check markdig advanced on babelmark):

<figure>
   <p>
  <img src="/kookaburra.jpg" alt="Kooaburra" title="Kookburra">
  <img src="/pelican.jpg" alt="Pelican stood on the beach" title="Pelican">
  <img src="/lorikeet.jpg" alt="Cheeky looking Rainbow Lorikeet" title="Rainbow Lorikeet">
  </p>
  <figcaption>From left to right, Kookburra, Pelican, and Rainbow Lorikeet.</figcaption>
</figure>

BTW, how does the Markdig Parser run in BabelMark? With all options enabled?

xoofx avatar Mar 15 '17 13:03 xoofx

Yeah I kind of agree about the explicit nature. PanDoc however does render figure captions (using styling rather than figure/figcaption tho)...

Thanks for the clarification.

RickStrahl avatar Mar 17 '17 08:03 RickStrahl

PanDoc however does render figure captions (using styling rather than figure/figcaption tho)...

Reopening and mark it as an enhancement. Implicit figure for image is something that can be done as part of the figure extension (through no spare time to work on this)

xoofx avatar Mar 17 '17 09:03 xoofx