jensmtg / influx

An alternative backlinks plugin, which displays relevant and formatted excerpts from notes with linked mentions, based on the position of mentions in the notes' hierarchical structure (bullet level indentation).
MIT License
310 stars 14 forks source link

Headers not being accurately detected #69

Open chuckharmston opened 1 year ago

chuckharmston commented 1 year ago

Describe the bug The header in the hierarchy is not being correctly identified if "Show headers" is enabled.

To Reproduce

  1. Create a note Test note with backlinks
  2. Create a note Test note with links, with the content:
    ## Test header 1
    - Some text
    ## Test header 2
    - [[Test note with backlinks]]
  3. View the Influx panel on Test note with backlinks

Expected behavior The header identified for the backlink will be "Test header 2"

Screenshots

CleanShot 2023-02-14 at 02 36 00@2x CleanShot 2023-02-14 at 02 36 05@2x

Desktop (please complete the following information):

Additional context N/A

Benjamin-Medina commented 1 year ago

I'm also having this issue, but inconsistently. For example, I record bulleted meeting notes all under a H1 heading, but only the heading appears in the linked file.

In another case from last week, the header connection worked just fine.

bn-bnelson commented 1 year ago

I am also having this issue inconsistently. Also on MacOS, Ventura 13.3.1.

alranel commented 1 year ago

I'm also having this issue. Apparently, all occurrences are reported under the first matching header.

bn-bnelson commented 1 year ago

FWIW, I've triaged this issue by just keeping my expectations for usage simpler. I have just figured out a format that works with the current code and have changed my note taking to match it.

I based the style on the image in this repository that shows the usage examples. Basically, I've gone to more bulleted lists and less headers. I find the plugin useful enough that this trade-off works for me.

thequilo commented 11 months ago

I observed the same issue with a note like this:

[[A]]

# Heading

where Heading is detected as heading for the link [[A]].

I guess this is related to #32. It would be really nice if the closest headline would be used instead of the topmost one.