zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.24k stars 233 forks source link

Transcluded block with a parent bullet does not embed sub-bullets #853

Closed ryanwwest closed 2 years ago

ryanwwest commented 2 years ago

Describe the bug

A transcluded block link with a parent bullet does not display embedded sub-bullets within Excalidraw, which is contrary to default Obsidian behavior.

To Reproduce

  1. Create a parent bullet and child bullets
  2. Create a block reference link to the parent bullet
  3. Transclude the link (using ! before said link) in Excalidraw (I did this within a Rectangle). Possibly reload Excalidraw to update link.
  4. Observe that only the parent bullet is visible, not child bullets.

Expected behavior

Both the parent bullet and any children (and sub-children) bullets should be displayed within Excalidraw if transcluding that block.

Screenshots

Here is an example parent bullet point with two sub-bullets, whose parent block can be referenced using the ^ character. Note that the Obsidian default embedded transclusion immediately below it shows both child bullet points. image

Here is the same block transcluded in a Excalidraw rectangle. Note that only the parent bullet point is displayed, even though the same embed link is used in both places: image

Environment (please complete the following information):

ryanwwest commented 2 years ago

I also just noticed that the parent bullet icon/character is not displayed. This doesn't matter to me for the parent, but I wonder if it should be displayed anyway for consistency with Obsidian, especially since displaying child bullet points would require this anyway.

zsviczian commented 2 years ago

I am able to reproduce. I am also thinking that if I transclude the entire document, then I should hide the ^block_references from the end of the paragraphs.

ryanwwest commented 2 years ago

I think that hiding them would make sense; it seems that this is already the Obsidian default for transcluding.

zsviczian commented 2 years ago

This looks better. I'll be testing the change for a few days to make sure it doesn't have unintended side effects

image

zsviczian commented 2 years ago

Should you also want to test the change you can replace the main.js in your .obsidian/plugins/obsidian-excalidraw-plugin folder to the one attached here. Don't forget to unzip.

main.zip

zsviczian commented 2 years ago

To be released in 1.7.26

ryanwwest commented 2 years ago

Thank you!