Use case or problem

I have commented material in my templates to remind myself to fill notes out in a certain way.

At the moment those comments are included in search results. I think it would be useful to have the option to exclude such meta-stuff so results focus on actual note content.

Proposed solution

Add a filter to search ignores material enclosed in comment tags ( <!-- or %% etc.)

Current workaround (optional)

I don’t have a workaround for this at the moment.

Related feature requests (optional)

Can’t find any.

As a workaround you could use the line:() or block:() search syntax:

line:(searchword -"%%" -"<!--")

or

block:(searchword -"%%" -"<!--")

+1 on this. Also, having this as a button to toggle in the search pane would be perfect. Here’s another use case with the Excalidraw plugin :

  • Context : In Excalidraw drawings, the drawings JSON instructions are stored in a commented out section of the note (%% %%). These sections are very long even for smaller drawings.
  • Issue : when doing searches in the search pane with the “Show more context” toggled on, if the results of the query includes text that is part of an Excalidraw drawing, Obsidian becomes very laggy and seems to have a hard time processing the search.
    • I personally would prefer to exclude by default the contents of these Excalidraw drawings from my searches instead of having to always add an operator to exclude them.