Images not updated until restart

Gustaf Ekeberg's Avatar

Gustaf Ekeberg

27 Jan, 2016 09:58 AM

// Please enter a detailed description of the issue // Description of the issue:


I'm working on a markdown preprocessor that processes a music snippet and generates a PNG. When the PNG is inserted the first time in my processed markdown file, it shows correctly. If the PNG changes, but not the filename, Marked wont update it until I restart the whole application.

This also happens if I option click a image and then choose to edit it. When the image is saved and I reload the image, it will not update until Marked is restarted.

// Please enter a list of steps required to reproduce the issue // Steps to reproduce:

  1. Open a markdown file in Marked that contain images.
  2. Edit one of the images.
  3. Reload the file.
  4. The changes to the images will not show until Marked is restarted.

// If applicable please attach a sample document that causes the issue for you.

// Configuration (do not edit) Marked 2 910 (Direct)

OS X Version: 10.11.2

allowPageBreakInCode: 1
bookTxtIsLeanpub: 0
codeIsPoetry: 0
collapsibleHeadlines: 0
convertGithubCheckboxes: 1
convertYAMLToMMD: 0
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: 0
defaultProcessor: MultiMarkdown
enableMiniMap: 0
excludeBlockQuotesFromCounts: 0
excludeFootnotesFromCounts: 0
excludeVerbatimFromCounts: 0
excludeCaptionsFromCounts: 0
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: 0
h1IsPageBreak: 0
h2IsPageBreak: 0
hrIsPageBreak: 0
includeMathJax: 0
limitTextWidth: 0
minimalJavaScript: 1
permissionGranted: 1
printHeaderFooterFirstPage: 0
processHTMLFiles: 1
removeMetadataForPreview: 0
removeYAMLHeaders: 0
scrollToEdit: 1
shouldDetectCritic: 1
shouldHighlightMarkupErrors: 1
shouldLoadCritic: 0
syntaxHighlight: 1

  1. Support Staff 1 Posted by Brett on 27 Jan, 2016 12:20 PM

    Brett's Avatar

    Does hitting ⌘R update the image?

  2. 2 Posted by Gustaf Ekeberg on 27 Jan, 2016 02:45 PM

    Gustaf Ekeberg's Avatar

    No update on ⌘R.

  3. Support Staff 3 Posted by Brett on 27 Jan, 2016 03:22 PM

    Brett's Avatar

    In your preprocessor, try appending a random query string to the image path to bust the cache, e.g.


    If the query changes with each write it may avoid the issue. Barring that, show me the markup that your script is sending back to Marked.



  4. 4 Posted by Gustaf Ekeberg on 27 Jan, 2016 06:33 PM

    Gustaf Ekeberg's Avatar

    Thank you for this solution, it works great and was really easy to add to my script!

    The script just replaces a LilyPond-section with something like this (with random string appended):

    <figure class="music-wrapper"><img src="lilypond-snippet-no-0.png?1234" /></figure>

    I think that it would be good if Marked could determine if an image was updated or not, sometimes you edit files and you want to see the result when hitting ⌘R.

    Thanks for a great product and great support!


  5. Support Staff 5 Posted by Brett on 27 Jan, 2016 06:49 PM

    Brett's Avatar

    It should already do that. It searches for IMG tags when loading and adds file watchers for detected local images. It usually works, but occasionally either caching or the method used to write to the file throws it off.



  6. Gustaf Ekeberg closed this discussion on 27 Jan, 2016 07:19 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? 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