Adding images inline

Hello everyone,

maybe someone could help me with the following problem:
Currently I use the gfm mode to get the wonderful markdown highlighting.

Now I want to add some kind of markdown image-url recognition and display the image below the urls.

These two programs do what I hope to archive:

  1. (it also uses codemirror / markdown)

I’ve tried to use widgets, but I’m honest… I did not understand a lot how to use them probably :frowning:

My goal:

  1. insert image markdown code (see below)
  2. codemirror inserts a widget (?) below the image line
  3. When edit or delete the url, the image also updates (or will be removed)

Is this a wish that I can realize or is it almost impossible?



    ![alt text]( "Logo Title Text 1")

    ![alt text][logo]

    [logo]: "Logo Title Text 2"

You probably want line widgets for this. When loading a document, scan it for image links and add the images. Then, on "changes" events, re-scan the area around the change and update the images, if any.

Hi marijn,
thank you very much for your response. That works very well.

One question:
How do I remove all Widgets of a given line?