mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-01 13:15:51 +00:00
This fixes a number of regressions from pandoc 2.x. Properly handle caption, alt attribute in figures. No longer treat a paragraph with a single image in it as a figure (we have a dedicated Figure element now). Closes #8930, closes #8871.
32 lines
1.0 KiB
Markdown
32 lines
1.0 KiB
Markdown
Treat an image alone in its paragraph (but not a figure)
|
|
as an independent image:
|
|
```
|
|
% pandoc -f native -t rst
|
|
[Para [Image ("",["align-center"],[]) [Str "https://pandoc.org/diagram.jpg"] ("https://pandoc.org/diagram.jpg","")]]
|
|
^D
|
|
|https://pandoc.org/diagram.jpg|
|
|
|
|
.. |https://pandoc.org/diagram.jpg| image:: https://pandoc.org/diagram.jpg
|
|
```
|
|
|
|
Here we just omit the center attribute as it's not valid:
|
|
```
|
|
% pandoc -f native -t rst
|
|
[Para [Str "hi",Space,Image ("",["align-center"],[]) [Str "https://pandoc.org/diagram.jpg"] ("https://pandoc.org/diagram.jpg","")]]
|
|
^D
|
|
hi |https://pandoc.org/diagram.jpg|
|
|
|
|
.. |https://pandoc.org/diagram.jpg| image:: https://pandoc.org/diagram.jpg
|
|
```
|
|
|
|
But we can use top, middle, or bottom alignment:
|
|
```
|
|
% pandoc -f native -t rst
|
|
[Para [Str "hi",Space,Image ("",["align-top"],[]) [Str "https://pandoc.org/diagram.jpg"] ("https://pandoc.org/diagram.jpg","")]]
|
|
^D
|
|
hi |https://pandoc.org/diagram.jpg|
|
|
|
|
.. |https://pandoc.org/diagram.jpg| image:: https://pandoc.org/diagram.jpg
|
|
:align: top
|
|
```
|