Does Marked 2 Use Image Attributes When Rendering Previews?

josh.fishburn's Avatar

josh.fishburn

25 Feb, 2019 07:56 PM

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?

  1. Support Staff 1 Posted by Brett on 25 Feb, 2019 08:22 PM

    Brett's Avatar

    Could you show me the syntax you're using for the attributes?

    Thanks,
    Brett

  2. 2 Posted by josh.fishburn on 25 Feb, 2019 11:07 PM

    josh.fishburn's Avatar

    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.

    ![Screenshot of ARIS lock screen for "Player has already viewed plaque"](https://d.pr/i/hIsgj6/iTVea34YTj+ "Screenshot of ARIS lock screen for "Player has already viewed plaque"" width=250)
    
  3. 3 Posted by josh.fishburn on 25 Feb, 2019 11:12 PM

    josh.fishburn's Avatar

    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:

    I don't know if there's a way to "restart", if by restart you mean "reset". But you can use locks to prevent a "restart" option from appearing until certain conditions are satisfied. For example, you can put a lock like this:
    
    ![](https://d.pr/i/hIsgj6/iTVea34YTj+ width=100)
    
    On a “Change Scene” trigger:
    
    ![Screenshot of ARIS Add Trigger screen showing Change Scene trigger](https://d.pr/i/D0CYUe/DpVzYYR5j9+ "Screenshot of ARIS Add Trigger screen showing Change Scene trigger" width=250)
    
    And the scene you change to could be the starting scene. In effect, this could function as a “reset”, as long as you also change the value of any items/attributes to their starting values.  
    <pre><code></code>
    </pre>
    
  4. Support Staff 4 Posted by Brett on 27 Feb, 2019 04:56 PM

    Brett's Avatar

    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:

    ![image 1][img1]
    
    [img1]: https://d.pr/i/hIsgj6/iTVea34YTj+ width=50px
    

    -Brett

  5. 5 Posted by Anders Ericsson on 10 Apr, 2020 07:08 AM

    Anders Ericsson 's Avatar

    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)

  6. Support Staff 6 Posted by Brett on 10 Apr, 2020 12:08 PM

    Brett's Avatar

    You have to be using the MultiMarkdown processor to use image attributes.

  7. 7 Posted by Anders Ericsson on 10 Apr, 2020 03:46 PM

    Anders Ericsson 's Avatar

    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.

  8. Support Staff 8 Posted by Brett on 10 Apr, 2020 03:53 PM

    Brett's Avatar

    Please provide full examples.

    - Brett

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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