-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- An image alone in its paragraph (but not a figure) is now rendered as an independent image, with an `alt` attribute if a description is supplied. - An inline image that is not alone in its paragraph will be rendered, as before, using a substitution. Such an image cannot have a "center", "left", or "right" alignment, so the classes `align-center`, `align-left`, or `align-right` are ignored. However, `align-top`, `align-middle`, `align-bottom` will generate a corresponding `align` attribute. Closes #6948.
- Loading branch information
Showing
3 changed files
with
52 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
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 | ||
.. image:: https://pandoc.org/diagram.jpg | ||
:alt: https://pandoc.org/diagram.jpg | ||
:align: center | ||
``` | ||
|
||
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 | ||
``` |