Incorrect search of tags and links in callouts with custom titles

Steps to reproduce

  1. Create callout with custom title and tag in the body:
>[!Note] Title
>Some text #tag
  1. Click on the tag to see the search results

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

Search should show the line of text where the tag is placed.

Actual result

Search show the empty line instead

Environment

SYSTEM INFO:
Obsidian version: v1.6.3
Installer version: v1.6.3
Operating system: Windows 10 Pro 10.0.19045
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

I tested this in sandbox and got different results when callout didn’t have a custom title or when the tag was placed in the callout title instead of the body.

These two callouts got expected results in the search:

And this one does not:

It seems that backlinks have the same bug:

But searching for simple text works as expected: