Scripts in posts?

There was a post regarding this matter a couple of years ago but I am hopeful if there is a way to do this.

https://meta.discourse.org/t/adding-a-javascript-in-a-post/130019/3

Olle