Backlinks and Search: Improvements to Show more context

As mentioned here Show more context on backlinks and search panes

There are improvements done to show more context in 0.12. In the first release post for 0.12 it will show the context for the markdown block. However if that markdown block is only one line of text the context is not enough!

For instance I have a specific line for tags and when searching for that tag I would like to see text close to the line with tags as well, not that single line.

Similarly, if the markdown block happens to be the title, I would like to be able to see what’s below the title, not just the title itself.

Use case or problem

Not seeing enough context. When the markdown block is only one line.

Proposed solution

See more context by surrounded markdown blocks.

Current workaround (optional)

Clicking on the more context arrow to expand the context. This is tedious, and makes me miss stuff. I need the overview to be able to find what I’m looking for.

11 Likes

The other opened issue for this is now marked as solved and it is in the feature archive, but it doesn’t seem like 0.12 actually changed anything in this respect. I thought the plan was to add an option to specify how much context to show in the search results?

Yes, I agree with the posts here. @WhiteNoise mentioned in this post when closing out the issue that “There will be a lot of work on this in 0.12” and we are now in v0.13 and these items around “more context” and controlling the amount of lines/context that can be seen have not been addressed. Here is where the comment was made and one of the FR was closed out prematurely: Show more context on backlinks and search panes - #18 by WhiteNoise

Here is another similar FR that was closed/merged but never implemented as well cc @roberthaisfield - Show more context in search results / backlinks

@WhiteNoise could we please get these older FR opened back up? They had quite a bit of good traction and conversation. Thanks!

So the 0.12 resolution to this issue was the addition of this button: Show more context.

image

The problem with this issue is that for some people the context is too much for other people is not enough. Anyway, further improvements/refinements/changes to show more context can be discussed here, I don’t want to resurrect the old threads.

1 Like

If a block is lines of text with spacing above and below it, then it’s considered a block. But I don’t see this actually happening, maybe improving this to actually be functionally how the program behaves can make the backlinks more effective.

Right now this is not how the program works. If I have bullet points, even without this spacing - still each bullet is considered a block.

I would suggest rather:

  • Bullet point list to be considered as one block
  • Heading elements shouldn’t be considered a block in itself, unless there is spacing between it.

@raaneem
I think that Headings, bullet points and also lists will always be considered as a block.

Reasons:
AFAIK, all Markdown features were designed with ability to convert into valid html elements.
Markdown headings are converted to html elements <h1> … <h6>, Markdown lists are converted to html lists <ol> or <ul> and single “bullet points” to html list items <li>. All the above belong to html block-elements. Lists as blocks do contain other blocks (list items).

Hi,

I am using backlinks with the “expanded view” functionality toggled on, so when I see a backlink, I can also see the text below it.

  • Now, if I create a link to [[2022-07-12]] in this bullet, and then I have a number of sub-bullets beneath this bullet (indented one or multiple levels in from this level), everything will show (as expected) in my expanded view on the page for “2022-07-12”. This is the correct and expected behavior

However, if - instead of using bullets, I decide to use a header style (#### [[2022-07-12]] is my header text), and then I place sub-bullets below this header, I am still able to collapse the text in the page that I’m writing, BUT when I go back to the “2022-07-12” page and look at the Linked Mention, none of my sub-bullets will appear in expanded view.

Why is there a difference between how Expanded View treats bulleted text vs. text that is organized in a hierarchy using header styles? It would be good to see this behavior made consistent.

I was told to log a FR for this feature.

1 Like

Hard to follow. Can you take screenshots?

I think sth like this. With list/bullets the expand button recognise the bullet’s children n thus show when u enable expand. But if header, the content within that header section is not recognised as “children”, thus not shown.

3 Likes

Exactly

+1 on this feature request. Another way to state the request is that when it comes to context, the block after a heading should be the child of that heading instead of just the sibling as it currently is.

So,

# [[some link]]
first block (won't be shown in search results even if you click "Show more context")

vs

- [[some link]]
	- this is considered a child and will be shown as "more context"
2 Likes

in logseq, linked references work exactly like this.
cant seem to find a way to do it in obsidian