# Modifying search results

**URL:** <https://meta.discourse.org/t/modifying-search-results/258897>\
**Category:** Development\
**Created:** [March 21, 2023, 2:37pm UTC](https://meta.discourse.org/t/modifying-search-results/258897 "2023-03-21T14:37:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [March 23, 2023, 11:28am UTC](https://meta.discourse.org/t/modifying-search-results/258897/4 "2023-03-23T11:28:08Z")

</div>

Update: the HTML generation in that widget was pretty complex and it had a lot of external dependencies. I also didn’t want to copy all that code to our plugin, so I ended up doing this

```js
      api.reopenWidget(`search-result-topic`, {
        html(attrs) {
          const html = this._super(attrs);
          // modify html as we see fit
          return html;
        }
      });

```

Modifying the already generated HTML is probably not the most elegant way to do it, but it saved me from having to copy a large block of code from core to the plugin, making the plugin more robust against future core updates.

---

_[View the full topic](https://meta.discourse.org/t/modifying-search-results/258897)._
