dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.75k stars 257 forks source link

Preview shows "Start anchor ... not found" when linking notes. #2568

Open jhoan2 opened 2 years ago

jhoan2 commented 2 years ago

Please select the area your bug applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

Describe the bug

Preview shows "Start anchor ^l8snrvxr0ub2 not found."

To Reproduce

Steps to reproduce the behavior:

  1. Go to the note
  2. Highlight the portion
  3. ctrl + shift r
  4. Go to another note and paste the link
  5. See error in preview pane.

Expected behavior

Expected for the preview to show the portion between the two block anchors.

Screenshots

image

image

Desktop (please complete the following information)

Additional context

Add any other context about the problem here.

Dendron Log file

dendron.log

Please attach the output of > Dev:Dendron: Open Logs here

hikchoi commented 2 years ago

Just for reference to whoever picks this up in the future:

preview is working as intended, but since the four lines here are one block of text in the syntax tree, copyNoteRef should only insert the end anchor in this case.

I also notice that when a codeblock is selected, the inserted anchors will not render properly in preview out of the box.

image

there may be more edge cases of faulty anchor insertions with multiline selections but I have not found anything else yet. Will report here if I find anything else.

jhoan2 commented 2 years ago

The command shouldn't insert anchors if the selection is inside a codeblock. (This is a bug with anchor insertion rather than preview rendering)

Harshita-mindfire commented 2 years ago

Thanks @jhoan2 for reporting the bug. Tracking it internally with: [[Preview Shows Start Anchor Not Found When Linking Notes|dendron://private/task.2022.03.15.preview-shows-start-anchor--not-found-when-linking-notes]]