Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert inline image removes existing node.note images and replaces them with the imported image #12

Open
victorburgos12 opened this issue Jul 10, 2023 · 1 comment

Comments

@victorburgos12
Copy link

victorburgos12 commented Jul 10, 2023

First of all, want to express how amazed I am by freeplane and it's features, thanks for this tool to all developers.
I just installed the addon Insert inline image.
I am experiencing a strange behavior.
If I import an image, the image gets imported correctly on the node notes section:
image
image

Then if I want to import another image, the previous one gets deleted and the new one appears:
image

I am not a developer, but with the help of ChatGPT I was trying to fix it without success.
Here is the code change that was proposed by ChatGPT on line 739 but could not make it work:

`def existingNoteContent = node.note // Get the existing content of the 'note' node

def newNoteContent = insertTag(existingNoteContent, imageTag) // Insert the image tag below the existing content

node.note = newNoteContent // Update the 'note' node with the new content
`

Thanks for the help.

@Pedro-Montanari
Copy link

Pedro-Montanari commented Mar 4, 2024

I am having the same issue with the "Insert Inline Image" addon.

In addition, pasting images from the clipboard (without using the "Insert Inline Image" addon) inside a node note sometimes work, and sometimes not.

I actually did not know about this addon. I assumed you could just paste images from the clipboard inside a note, and by luck in my first tries this worked, but then I started having some problems with some images not being pasted at all or being pasted in a "broken" state (see attachment).

Broken

In the above both images were pasted from the clipboard, with the 1st working and the 2nd not. I got both images on Google Images.

If it could help this is the HTML code of both images on Freeplane:

</p>
  <img src="https://w7.pngwing.com/pngs/286/579/png-transparent-broken-glass-glass-fragmentation-broken-thumbnail.png" jsaction="VQAsE" class="sFlh5c pT0Scc iPVvYb" alt="Broken png images | PNGWing" jsname="kn3ccd" aria-hidden="false" style="width: 360px; height: 360px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;">
  

  <p>
    
  </p>
  <img src="https://www.freeiconspng.com/thumbs/broken-png/broken-png-1.png" jsaction="VQAsE" class="sFlh5c pT0Scc iPVvYb" alt="Broken PNG, Broken Transparent Background - FreeIconsPNG" jsname="kn3ccd" aria-hidden="false" style="width: 320px; height: 258px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;">
  


  <p>

From my experience this has been a bit casual and independent of image tpye (.png, .svg) or location (link from URL or saved on the PC).

I'm running Windows 11 Enterprise, Freeplane 1.11.11 with Java 15.0.10, and Insert Inline Image 1.1.

WTBS I also want to give a shout to freeplane developers and contributors. I started using it recently at the overall experience has been marvellous.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants