kaesa wawa
Pretty explanatory

just a button or smth to preview a message before sending it smile
gockdog enjoyer
admin soon
its a great idea but its another parser and another renderer (but js this time)

unless it's done as a request to the server but i feel like that's abusable (i dont think i like Babycode-As-A-Service lol)
im Normal and you'r NOT.
bear that in mind.
kaesa wawa
well then maybe add a cooldown or limit?

i feel like it would be easier to do something like that server-side and just do a request from js (that way 1 parser to maintain). like limiting a preview per user at 1 every 5/10sec (would just need to keep a "last preview timestamp" per user, no?). Plus that way a user will need to be connected to use it, so if there is abuse it's traceable to which user is abusing it.
gockdog enjoyer
xananax potentially in the bathroom
Usually, this is done with a server request; Github, Discourse, and others, all render the preview on the server. Making a parser that works exactly the same in JS is not practically doable; there will be minor differences and bugs, and both implementations would need to be updated at the same time. It's not viable. The only communities that do that are made in JS in the first place (Node/Deno/etc) -- typically even those render on the server.

And yes, you can get the session from the user (since only logged in users can do that) and record last request time; if delta last request to now is > some time, refuse the request. You can have a Js counter client-side to tell the user "next preview in 1 second" if they click "preview" too fast.
I know what you're thinking
admin soon
in main now, archiving smile
im Normal and you'r NOT.
bear that in mind.
Are you sure you want to delete the highlighted post?