org-roam / org-roam-ui

A graphical frontend for exploring your org-roam Zettelkasten
GNU General Public License v3.0
1.98k stars 109 forks source link

[BUG] Org attach preview doesn't work with inherited ID #246

Closed danhuynhdev closed 2 years ago

danhuynhdev commented 2 years ago

Describe the bug When using org-attach with a file-level ID, the preview seems to ignore the id path and simply replace attachment: in file link with file:

To Reproduce Using this note

:PROPERTIES:
:ID:       93197811-f69e-4624-b98c-853a31d52355
:ROAM_REFS: https://en.wikipedia.org/wiki/System_context_diagram
:END:
#+title: System context diagram

* Definition :ATTACH:
A system context diagram (SCD) in engineering is a diagram that defines the
boundary between the system, or part of a system, and its environment, showing
the entities that interact with it.This diagram is a high level view of a
system. It is similar to a block diagram.

#+ATTR_HTML: :width 550px
[[attachment:_20220629_135349screenshot.png]]

Expected behavior Preview shows the image

Actual behavior Doesn't show the image Screenshots image

danhuynhdev commented 2 years ago

This seems to be fixed when adding the useInheritance: true to uniorg-attach.

danhuynhdev commented 2 years ago

Can you take a look at the PR @ThomasFKJorna ?

rasendubi commented 2 years ago

Hey. Could you please share your values for org-attach-use-inheritance and org-use-property-inheritance, and whether they have been changed from their defaults?

On Wed, Jun 29, 2022, 10:29 Huynh Tan @.***> wrote:

Can you take a look at the PR @ThomasFKJorna https://github.com/ThomasFKJorna ?

— Reply to this email directly, view it on GitHub https://github.com/org-roam/org-roam-ui/issues/246#issuecomment-1169631537, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKNTE5BDQAS3NWIMFOOAD3VRP3MHANCNFSM52EVC44A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

danhuynhdev commented 2 years ago

image image I haven't changed anything related to org-attach so pretty sure this is doom-emacs' default

danhuynhdev commented 2 years ago

Found the config in doom-emacs

https://github.com/doomemacs/doomemacs/blob/bea3cc161c0a803dcf574f32ee555dccf565a5ce/modules/lang/org/config.el#L500-L503

danhuynhdev commented 2 years ago

Okay so a proper fix should be looking up that value and pass it to org-ui 🤔