On JavaScript injection in markdown component

Take a look at some of my posts, i do a bunch of stuff with markdown js.
There is a lot more you can do with this.

With some string replace, i fixed the space/tab formatting issues, allowing you to code a bit more cleanly.
Using an img' onload function you can trigger anything screen wide,
With some mutation observers you can trigger stuff on data changes (quite advanced js knowledge required).
With window.__client, you can access perspective properties and even write to them ect.

(ive done a lot of stuff so these are just a few examples)

It can also be used to add some dynamic css to parts of components that otherwise cant be accesed

Not the markdown, but another way to add js in perspective, though i have not really done a lot with this yet

6 Likes