I have been looking at Pagedown.js lately for the allure of using mark-down on my pages instead of ugly readonly textareas.
I am extremely cautious though as it seem
Not at all safe.
Client side sanitation/validation should be used for few reasons:
Everything that you validate can be changed because the client is not controlled by you. Things like dev console, fiddler, wireshark allows you to manipulate the data in basically any way you want.
So only server is responsible for real sanitation/validation.