Reputation:
I am looking for a markdown language that works similiar to the one used here on stackoverflow.
I could go and write my own Markup language but I think this will be a waste of time. This is a possibility though.
What I really want to know is if the StackOverflow markdown language is opensource or if there are similiar opensource packages available for use in PHP.
Upvotes: 1
Views: 118
Reputation: 4002
You should look for an already existing library that you can plug in and use.
Firstly you need to decide between two major groups of markdown implementations
Stackexchange uses what I would call basic or original markdown.
Some search terms you should explore:
I use PHP Parsedown. I find it effective but a bit quirky and intolerant.
You should note that the Markdown definition is very fractured, apart from CommonMark the markup used by the original and other implementations isn't well-defined and so different implementations will often produce different results and support different features.
There are some security concerns. Markdown accessible to end-users allows them to insert arbitrary HTML which can introduce cross-site scripting and other security problems. You may need to pre-process the markup or post-process the HTML to remove problematic elements. Stackexchange allows only a limited subset of HTML for this reason.
Upvotes: 2