Search in Current File: No Highlighting in Frontmatter

What I’m Trying to Do

Hi, I’m wondering why matching search terms are not highlighted inside the frontmatter, as shown in (1) in the image below:

What I’ve Tried

I searched for answers but couldn’t find a solution to this issue. I’d really appreciate any clarification on this.

When searching inside a note, Obsidian puts a <span> element with class obsidian-search-match-highlight around the matched text. That allows to style the highlight.

However, for some reason, Obsidian does not put that <span> around matched text inside the properties when in live preview. Since the text is not marked, this cannot be remedied via css.

In Source mode, however, the span mechanism is applied to front matter too (even to property names), so you can temporarily switch to source mode to see it. I have mapped a hot key (Shift+Ctrl+E) to switch back and forth to source mode.

1 Like

Thanks for the response. Unfortunately, even in source mode, I’m still seeing this inconsistent behavior on my end.

Did you click on the icon next to the “arrow down”? It is to highlight all occurrences.

Also, the fist time I switched to source mode, I had to click one of the arrows (I don’t know why, it didn’t happen again)

Yes. But no success.

Perhaps your theme is interfering? Try using default theme

2025-07-17_10-44-20

Unfortunately, it had no impact.

I turned off all plugins, and now it works! I will go through them to find the culprit. Thanks for your patience and help. Have a good day!

I found the culprit:

Oh, I see. In your case the values of the properties were wikilinks. Frontmatter Links plugin wraps them in a <a> tag, which removes the <span> used by Obsidian to mark the matching text. That explains why it is found nevertheless later in the main body, where the plugin did not interfere.