I'm looking at using WMD in my project instead of my existing RadEditor. I have been reading a few posts on how to store and retrieve the data, and I want to make sure I have the concept correct before proceeding.
If my research is correct, here is what I should be doing.
- I should store the editor data twice (Once as HTML and once as Markdown)
- I should run the HTML through a Whitelist before storing it.
- I should run the HTML through AntiXSS on the way out (before displaying)
- I should use the Markdown data ONLY to repopulate Markdown for editing.
Can anyone confirm or deny if this is correct, and also add any useful input on the subject?
Reformat my code: Sanitize Html
StackOverflow: how do you store the markdown using wmd in asp net
StackOverflow: sanitize html before storing in the db or before rendering antixss library
StackOverflow: store html entities in database or convert when retrieved
How do I program against a local database while I develop in ASP.NET MVC?
1:Validate DateTime with DataAnnotation
- I use the
wmd.jsas the client side editor.
- I use the MarkdownSharp server side processing.
- Introducing MarkdownSharp
- Three Markdown Gotchas
- Markdown, One Year Later
- Reverse Engineering the Markdown Editor
- WMD Edtior Reverse Engineered
- I store the post in the form it was submitted in; It's displayed using MarkdownSharp.
- I sanitize the HTML using Jeff Atwood's approach (On output, not on input).
- I utilize ASP.NET MVC 'best practices' (a highly subjective term) to deal with XSS and XSRF.