---
title: "Fixing the search #2"
slug: fixing-the-search-2
section: tech
date: 2015-05-30T17:42:00.000Z
canonical: https://roland.leth.ro/blog/tech/fixing-the-search-2
---

[Previously](/tech/blog/fixing-the-search) I said I had to scan the `href`s for my `search-mark` `span`s, but I forgot my assets:

```ruby
content.scan(/\/assets\/.*?"/).each do |s|
  edited_link = s.gsub('<mark class=\'search\'>', '')
  edited_link.gsub!('</mark>', '')
  content.gsub!(s, edited_link)
end
```

Sadly, I didn't find a proper way to skip `URL`s, so I have to scan several times to remove `search-mark` from them :(