I am migrating a discussion forum from OSQA to Discourse. I am stuck at one problem in doing so.
Since its a discussion forum for coding related topics, much of the posts contains code snippets. Many of the users being beginners do not format their code properly i.e. do not indent while including a code block or use back-ticks before starting a code-block and after ending one.
Now, such unformatted code snippet worked in OSQA but not in Discourse.
Discourse hides <iostream>
much like stackoverflow (perhaps considering the former as an HTML tag?).
Also, if a user directly pastes his/her code, the the formatting starts once an indentation starts.
Example:
#include <stdio.h>
int main()
{
// formatting starts from here as prinf("Hi"); is indented.
// the first two statements are not formatted as they have not been indetned.
printf("Hi");
return 0;
}
I hope you all get the idea. It looks way bizarre. Let me add a image for more clarity.
Did you see what I was trying to say?
Now, Discourse will not allow to post such posts. But what about the imported 20k+ posts ?
How do I detect if the posts has proper markdown or not? Please help me here :(