Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
1.9k views
in Plugins by
edited by

I'm using this version of markdown editor on my site for writing questions and answers. Now I want to use this editor for writing comments, too, but I don't want all features of this editor such as inserting images, quoting, creating lists etc. In other words, I just want these features: 

  1. **bold**
  2. *italic*
  3. [linked word](http://test.com)
  4. `some inline code here`

Also I do not obviously want the editor button anymore for comments. I just want a simple editor for writing comments with above four features, just like StackExchange editor for comments. How can I do this?

Q2A version: 1.6.3
by
just bumping!

1 Answer

+1 vote
by

You might want to look at making your own viewer module: http://question2answer.org/modules.php?module=viewer

You can use the standard plain text editor, then in the viewer module use some simple regular expressions to create the HTML for those styles, e.g.

    preg_replace('/\*\*(.+?)\*\*/', '<b>$1</b>', $content);

If you want buttons for making bold, italic etc like the markdown editor maybe you can take that editor and remove some stuff.

by
Thank you very much for your reply, but could you please explain your answer in more detail?
I'm completely new in Q2A.
...