<p>I'm trying to implement the WMD editor used on StackOverflow to create some basic Wiki-style functionality.  I'm up to the point where it's time to save to the database, but I'm unsure as to what I should be saving.</p>

<p>If I save the produced HTML then I can retrieve and display it correctly, but on re-edit I'm faced with editing HTML, not Markdown.  However, if I save the Markdown I can't see any way of converting this back to HTML to display, and looking at StackOverflow it sends the browser HTML.</p>

<p>I'm guessing that I don't need to save both, so what simple thing am I missing?</p>

I would suggest saving the exact entered text to the database, so editing will work with the original markdown or HTML.
When you retrieve the text for display, you parse it on the server side and convert to HTML where necessary
[Edit]
At comment:
You seem to have a way of parsing and converting to HTML already, if I understand your question correctly.  Here you talk about the produced HTML.
If I save the produced HTML then I can retrieve and display it correctly, but on re-edit I'm faced with editing HTML, not Markdown