# How to override a method in post-cooked.js.es6 in a plugin?

**URL:** <https://meta.discourse.org/t/how-to-override-a-method-in-post-cooked-js-es6-in-a-plugin/120613>\
**Category:** Development\
**Created:** [17 juni 2019 om 21:15 UTC](https://meta.discourse.org/t/how-to-override-a-method-in-post-cooked-js-es6-in-a-plugin/120613 "2019-06-17T21:15:37Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![spirobel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spirobel/32/170908_2.png) [@spirobel](https://meta.discourse.org/u/spirobel)\
**Post date:** [27 juni 2020 om 08:36 UTC](https://meta.discourse.org/t/how-to-override-a-method-in-post-cooked-js-es6-in-a-plugin/120613/4 "2020-06-27T08:36:47Z")

</div>

I am not sure. I didnt look into it yet. I want to replace  
[discourse/app/assets/javascripts/discourse/app/widgets/post-cooked.js at eab560fe2aa9053f6d227d29ec6c1ad0939ea940 · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/eab560fe2aa9053f6d227d29ec6c1ad0939ea940/app/assets/javascripts/discourse/app/widgets/post-cooked.js#L303)  
\_computedCooked by category.  
I want to replace

```javascript
 cookedDiv.innerHTML = this.attrs.cooked;

```

with custom content depending on the category. But it makes sense. this should also be possible with decorateCooked. after reading a bit it seems like decorateCookedElement might be the right one, as I dont want to use jquery. Thaaanks 😃

---

_[View the full topic](https://meta.discourse.org/t/how-to-override-a-method-in-post-cooked-js-es6-in-a-plugin/120613)._
