vipzhicheng / logseq-plugin-mark-map

This is a plugin for https://github.com/logseq/logseq to provide mindmap support based on https://github.com/markmap/markmap.
280 stars 6 forks source link

png not loading #25

Closed dnlzm closed 1 year ago

dnlzm commented 2 years ago

Any image.pnd embedded in a page will trigger the white square popup with spinning circle, but does not continue to showing the image.

vipzhicheng commented 2 years ago

I can not reproduce this issue, which means on my local(Mac), png image can be shown correctly, so what is your env?

tws14er commented 2 years ago

I am experienceing the same problem as dnlzm - image links just show a square popub with spinning circcle - no image shows. Windows 11 laptop. LogSeq version 0.7.9. Screenshot 2022-08-02 150438

working-name commented 1 year ago

@vipzhicheng Same thing happens here, I was able to make it load by prepending the href's value for the lightbox link with assets://. Right now the path passed to that href is just /Users/... which is highly unlikely to load. Prepending with file:// will not load either due to electron or whatever.

The other question I have - why not simply display the picture inline as well? I understand that it'll mess with the distance between branches so that may be difficult to handle, but with a modest height it should be achievable and not look terrible. Just thinking out loud.

vipzhicheng commented 1 year ago

My test case is that images are always in assets folder whether copy-n-paste or drag-n-drop with a relative path, so I'm not sure how it can be /Users/. And when I manually make it absolute path, I found that issues come up not only not loading but also messed up. So for now I can just suggest not using the absolute path style.

working-name commented 1 year ago

I don't manually edit the path, and did not change anything about Logseq or your plugin. It also has position issues on first initialization. Here's a recording of a vanilla logseq + markmap plugin install: video

vipzhicheng commented 1 year ago

@working-name thx for your screencast, I think I know what happened. And I just release a new version which add assets:// automatically. Please take a look if it works for you. And I also need to find a Windows machine to have a test.

tws14er commented 1 year ago

I checked the update on a Windows machine, and it works fine.

Thanks.

Tom

On Sun, Oct 9, 2022 at 2:28 AM Richard Yu @.***> wrote:

@working-name https://github.com/working-name thx for your screencast, I think I know what happened. And I just release a new version which add assets:// automatically. Please take a look if it works for you. And I also need to find a Windows machine to have a test.

— Reply to this email directly, view it on GitHub https://github.com/vipzhicheng/logseq-plugin-mark-map/issues/25#issuecomment-1272487813, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2LA3VVBEDUXARWUS242ACLWCJ6Y7ANCNFSM5T3ELQUA . You are receiving this because you commented.Message ID: @.***>

working-name commented 1 year ago

@working-name thx for your screencast, I think I know what happened. And I just release a new version which add assets:// automatically. Please take a look if it works for you. And I also need to find a Windows machine to have a test.

Confirmed, works great on macOS too. Thank you! 👍

balta2ar commented 1 year ago

I'm on Linux (Manjaro), using v0.2.11. I can't seem to display images. Let's say I have this structure with relative path to assets:

image

When I open Markmap, I see: image

And then if I click on the PNG link, I get: image

At the same time I have few errors in the log, but I don't know if they are related to this problem:

index.d33125f7.js:148 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'resetTheme')
    at J.<anonymous> (index.d33125f7.js:148:1408)
    at m.emit (logseq.0b585b9b.js:3:1808)
    at Ne.<anonymous> (logseq.0b585b9b.js:12:30151)
    at m.emit (logseq.0b585b9b.js:3:1768)
    at #lspmsg#settings# (logseq.0b585b9b.js:12:20841)
    at logseq.0b585b9b.js:12:16617

core.cljs:4051 [frontend.modules.shortcut.core] {:shortcut/register-shortcut {:id :plugin.logseq-move-block/move-block, :binding "ctrl+shift+m", :error #object[Error Error: Keyboard shortcut conflicts with existing shortcut: null]}, :line 70}

module.js:215 Unexpected error when checking capturing opt-out status: TypeError: Cannot read properties of undefined (reading 'token')
(anonymous) @ module.js:215
(anonymous) @ core.cljs:32
$APP.k.F @ core.cljs:11369
e @ handler.cljs:46
f @ handler.cljs:74
pr @ async.cljs:24
(anonymous) @ async.cljs:24
(anonymous) @ channels.cljs:30
hua @ channels.cljs:17
Iba.b.port1.onmessage @ promise.js:817
core.cljs:3669 TypeError: Cannot read properties of undefined (reading 'incr')
    at sc.<anonymous> (module.js:5334:7)
    at sc.capture (module.js:241:7)
    at core.cljs:32:5
    at $APP.k.F (core.cljs:11369:26)
    at e (handler.cljs:46:9)
    at Function.f [as F] (handler.cljs:74:5)
    at pr (async.cljs:24:4)
    at async.cljs:24:4
    at channels.cljs:30:1
    at hua (channels.cljs:17:3)
(anonymous) @ core.cljs:3669
$APP.k.F @ core.cljs:11369
e @ handler.cljs:46
f @ handler.cljs:74
pr @ async.cljs:24
(anonymous) @ async.cljs:24
(anonymous) @ channels.cljs:30
hua @ channels.cljs:17
Iba.b.port1.onmessage @ promise.js:817
module.js:215 Unexpected error when checking capturing opt-out status: TypeError: Cannot read properties of undefined (reading 'token')
(anonymous) @ module.js:215
(anonymous) @ core.cljs:32
$APP.k.F @ core.cljs:11369
e @ handler.cljs:46
f @ handler.cljs:74
pr @ async.cljs:24
(anonymous) @ async.cljs:24
(anonymous) @ channels.cljs:30
hua @ channels.cljs:17
Iba.b.port1.onmessage @ promise.js:817
core.cljs:3669 TypeError: Cannot read properties of undefined (reading 'incr')
    at sc.<anonymous> (module.js:5334:7)
    at sc.capture (module.js:241:7)
    at core.cljs:32:5
    at $APP.k.F (core.cljs:11369:26)
    at e (handler.cljs:46:9)
    at Function.f [as F] (handler.cljs:74:5)
    at pr (async.cljs:24:4)
    at async.cljs:24:4
    at channels.cljs:30:1
    at hua (channels.cljs:17:3)
balta2ar commented 1 year ago

I tried disabling all other plugins and leaving only this one active, and the problem remained.

vipzhicheng commented 1 year ago

I'm on Linux (Manjaro), using v0.2.11. I can't seem to display images. Let's say I have this structure with relative path to assets:

image

Seems you not use images correctly. You should make the images shown on Logseq first by the syntax ![image name](../assets/...)

Logseq console always has some errors, just ignore them.

balta2ar commented 1 year ago

Interesting! I get this string when I copy an image to a clipboard from another app and I Ctrl-V it in logseq, and then logseq renders it correctly: image Looks like logseq can render both ![image name](../assets/...) and [[../assets/...]].

However, when I tried converting the first image link for the format your suggested:

- Ebbinghaus forgetting curve  
    - uten repetisjon  
        - ![name](../assets/image_1666542413704_0.png)  
    - med pepetisjon  
        - [[../assets/image_1666543027135_0.png]]  

I got this: image I don't know if it matters, but I'm using "org" format in this document, not "md".

vipzhicheng commented 1 year ago

Yes, it's the key. I have released a new version to fix this issue, please take a look.

balta2ar commented 1 year ago

It works now! Thank you for your help! :heart: