Support Pandoc style image attributes
See original GitHub issueWhat is the problem?
Pandoc has this way of adding attributes to an image tag:
An inline ![image](foo.jpg){#id .class width=30 height=20px} with attributes.
Seen in https://pandoc.org/MANUAL.html#Images.
Currently, the extension doesn’t support this syntax, and will display the attributes {#id .class width=30 height=20px}
as text following the image instead.
We are only able to write something like
[<img src="foo.jpg" width="30" height=20px/>](image)
to get the same behavior (which is to change the image size in this case), and pandoc will not display the image in an generated PDF.
It would be very nice if the extension supports the Pandoc syntax, since I write in markdown and use Pandoc to generate latex style documents, and it would be cool to see the images displayed the way they would be in a PDF.
How can I reproduce it?
Have an image named foo.jpg
in the same directory as the markdown file, and include ![image](foo.jpg){#id .class width=30 height=20px}
in the file.
Is there any error message in the console?
No.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Glad to hear that.
The good thing is we can use this extension and MPE at the same time (no conflict). It is a solution for those who need more features than that of the CommonMark/GitHub Flavored Markdown.
I checked using the Pacdoc parser. It works great now.
For reference, I needed to add
--mathjax
to the pandoc arguments and change the “Pandoc markdown flavor” tomarkdown-raw_tex+tex_math_dollars
, both of which are Markdown Preview Enhanced settings.I still appreciate the nice features of Markdown All in One. I like how it respects the markdown css settings and how fast it runs. Thanks for developing such great extensions!