Does Marked 2 Use Image Attributes When Rendering Previews?
The question in my subject reflects a gap in knowledge that I'm trying to fill. The Ulysses Beta added support for width and height attributes for images, so I thought I'd try it, but the images I added these attributes to weren't showing properly in Marked's preview. Ulysses support suggested that Marked's built-in multimarkdown might be the issue, so I added my installed version of multimarkdown as a custom processor. The images now show when they have either the width, height, or both of the attributes set in Ulysses and I preview the Ulysses sheet in Marked 2. However, Marked 2's renderer seems to ignore the attribute (my images are all the same size).
This part of the multimarkdown syntax guide tells me that maybe that's expected behavior:
Currently, MultiMarkdown does not attempt to interpret or make any use of any of these attributes.
So if Multimarkdown doesn't interpret them, is that why Marked 2 is also ignoring them in the preview? And if I did want the "Copy as HTML" to interpret those attributes, how could I go about interpreting/bringing the attributes along with that command?
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 25 Feb, 2019 08:22 PM
Could you show me the syntax you're using for the attributes?
Thanks,
Brett
2 Posted by josh.fishburn on 25 Feb, 2019 11:07 PM
Sure, here's an example from the Ulysses sheet I was experimenting with. This is what I see after using Ulysses preview with "Text", "Text Bundle", and "Open in Marked 2" as the export settings, and then using File->Open in Editor in Marked 2 to get the generated Markdown.
3 Posted by josh.fishburn on 25 Feb, 2019 11:12 PM
Actually, if I take out the quotes from my caption, the image sizing works. I tested it with a couple different sizes and saw them both show at the proper size in the Marked 2 preview, so maybe those quotes were throwing it off. I still needed to use the custom recent MultiMarkdown processor to get them to show properly with the width/height attributes. Heres the full markdown text below:
Support Staff 4 Posted by Brett on 27 Feb, 2019 04:56 PM
There does seem to be a general issue with attributes in inline links with Marked's MMD processor, so I'll need to look into that. As a workaround, using reference links works fine with attributes, but you need to include "px" in the attibute, like:
-Brett
5 Posted by Anders Ericsson on 10 Apr, 2020 07:08 AM
I use the reference link suggestion given by Brett to size an image which is on my hard drive and it does not work - the image is not rendered at all (and it is rendered if I remove the size option). The example given by Brett works though. Any ideas here?
I've dug through stackoverflow and other sites but I cannot resolve this without other side effects such as removed alt parameters (if I for instance use HTML like <p style= ... or <div ...)
I'm using Marked Version 2.5.39 (985) together with version 13.0.6 of BBEdit (the latter should not matter really)
Support Staff 6 Posted by Brett on 10 Apr, 2020 12:08 PM
You have to be using the MultiMarkdown processor to use image attributes.
7 Posted by Anders Ericsson on 10 Apr, 2020 03:46 PM
Sure, that box is checked and it works on the example you gave https://d.pr/i/hIsgj6/iTVea34YTj - but not with a a file link that works well without the attributes. Any pointers would be appreciated.
Support Staff 8 Posted by Brett on 10 Apr, 2020 03:53 PM
Please provide full examples.
- Brett