Anchor links only in HTML, not in feeds?

I’ve got my own version of the anchor-link.html template, which works well in HTML, but the image I’m using doesn’t make a lot of sense when viewed with an RSS reader. I’m wondering if there is a way to detect when the template is being rendered for a feed, and to have it return different content, or no content at all? I couldn’t find any variables in the __tera_context that looked like they would help here.

The markdown is rendered only once, there’s no context. You could write a custom feed template and somehow remove them from the HTML?

Would I need to remove them using the replace filter? There’s enough HTML that it would be fiddly, unless replace were to accept a regex.