in Education by
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. 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. I'm guessing that I don't need to save both, so what simple thing am I missing? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Absolutely save the Markdown code as entered by the user. Then you'll need a Markdown converter that will convert it to HTML for displaying it. You'll find a bunch of these at http://en.wikipedia.org/wiki/Markdown#Converters and http://markdown.infogami.com/ I'd vote against using JS in your case. There appears to be a .NET implementation but I can't tell you how good it is. While rendering your page you'll have to pass the Markdown code to a converter like the above and then output the returned HTML. If performance is an issue you might also consider saving both the Markdown code (for later editing) AND the HTML code (for displaying) inthe database. That way it will only be converted once.

Related questions

0 votes
    I'm trying to implement the WMD editor used on StackOverflow to create some basic Wiki-style functionality. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 18, 2022 in Education by JackTerrance
0 votes
    The following are operating system processing program except? A. Control programs B. Utility programs C. Library ... Linkage editor Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    I create a plot_ly image using: MilesPlotly...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I create a plot_ly image using: MilesPlotly...
asked Jul 6, 2022 in Education by JackTerrance
0 votes
    I am working on wordpress with woocommerce and using WCK plugin for custom fields. I am creating products ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I am trying to do some validation on the file name before it's saved. Here are my three file- ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    I have a text file, by which I am trying to write to in my program. Whenever user wants to add ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    In my application I have a table view and the user is able to add and delete cells in that table ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    .rda extension used when saving data with function __________ (a) save() (b) save.image() (c) save and ... Operations of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    I have an identifying relationship between two tables in the database. The parent table has a primary key ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 11, 2022 in Education by JackTerrance
0 votes
    I've trained a sentiment classifier model using Keras library by following the below steps(broadly). Convert Text ... around this? Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    I want to save files for each result from the loop. For example, I wrote the code but it only saves one file ... do I modify my code? Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    Cost saving is possible in networking due to: (a)Data sharing (b) Software sharing (c) Both i and ii (d)None of these Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    ____is the default File Extension for saving presentation in Power point 2013. Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    How do you computers networks help in reducing the cost and saving money very short answer Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
...