Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 955989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:28:25+00:00 2026-05-16T00:28:25+00:00

I have a requirement for users to create, modify and delete their own articles.

  • 0

I have a requirement for users to create, modify and delete their own articles. I plan on using the WMD editor that SO uses to create the articles.

From what I can gather SO stores the markdown and the HTML. Why does it do this – what is the benefit?

I can’t decide whether to store the markdown, HTML or both. If I store both which one do I retrieve and convert to display to the user.

UPDATE:

Ok, I think from the answers so far, i should be storing both the markdown and HTML. That seems cool. I have also been reading a blog post from Jeff regarding XSS exploits. Because the WMD editor allows you to input any HTML this could cause me some headaches.

The blog post in question is here. I am guessing that I will have to follow the same approach as SO – and sanitize the input on the server side.

Is the sanitize code that SO uses available as Open Source or will I have to start this from scratch?

Any help would be much appreciated.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:28:26+00:00Added an answer on May 16, 2026 at 12:28 am

    Storing both is extremely useful/helpful in terms of performance and compatiblity (and eventually also social control).

    If you store only Markdown (or whatever non-HTML markup), then there’s a performance cost by parsing it into HTML flavor everytime. This is not always noticeably cheap.

    If you store only HTML, then you’ll risk that bugs are silently creeping in the generated HTML. This would lead to lot of maintenance and bugfixing headache. You’ll also lose social control because you don’t know anymore what the user has actually filled in. You’d for example as being an admin also like to know which users are trying to do XSS using <script> and so on. Also, the enduser won’t be able to edit the data in Markdown format. You’d need to convert it back from HTML.

    To update the HTML on every change of Markdown version, you just add one extra field representing the Markdown version being used for generating the HTML output. Whenever this has been changed in the server side at the moment you retrieve the row, re-parse the data using the new version and update the row in the DB. This is only an one-time extra cost.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am completely new to java, but I have urgent requirement to create a
I have an application that uses a Mutex for cross process synchronization of a
Summary We have an ASP.NET application that allows users to query a SQL Server
I have wcf client. It uses .NET 3.5. When I compile the client I
The apps that I build frequently have 'social media service' requirements; e.g. Twitter bit.ly
I've got a Rails 3 app (using Mongodb and Mongoid if that makes a
I am trying to create a system which allows local network users to collaborate
Consider the following scenerio.... I have a master user MASTER. I have a test
We are designing our new product, which will include multi-tenancy. It will be written
My team has a service deployed internally, and part of this service is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.