Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
  • Register
Welcome to the Q&A for Question2Answer.

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

I made a Markdown editor plugin for Q2A - thoughts/suggestions?

+12 votes

I've been working on this on and off (mostly off), for a few months now. Finally I got round to finishing it to a reasonable state! It's a Markdown editor plugin, which has several advantages over CKeditor, the default in Q2A.

More details on the plugin, instructions and files to download are available here: http://codelair.co.uk/2011/markdown-editor-plugin-q2a/

It's licensed under GPL so it's free and open source. There are some minor bugs that I haven't managed to fix just yet, so if anyone manages to fix them please let me know and I will update it. Also, I have copied the files direct from my Q2A site where it's been in use for the last little while, so if there turns out to be any site-specific code that I left in there let me know ;)

 

I'd love to know what you think, and any suggestions for improvements! Just post an answer here.

 

 

asked Jul 16, 2011 in Plugins by DisgruntledGoat
recategorized Nov 13, 2011 by gidgreen
Is it possible to allow people to upload attachments with the markdown editor?
@Trobee, not at the moment but over Xmas I'm gonna work on a new version and I'll keep this in mind.

6 Answers

+2 votes
Wow, Markdown plugin really has sense for me! Definitely I test it and I'm interested in father development.

I think we need simple WYSIWYG editor  with markdown like one at StackOverflow.
answered Jul 18, 2011 by Ambix
0 votes

I have problem

answered Jul 24, 2011 by Alexey
Yep, that's what it looks like for me if I turn off CSS. So make sure to copy the CSS from sample.css to your qa-styles.css.
Oops, Sorry =[
thank you:)
0 votes
"Open entered links in a new window:" feature doesn't work with Markdown editor.
answered Jul 25, 2011 by Another one
a temporary solution is to open:
qa-plugin\markdown-editor\inc.markdown.php

navigate to line 608 that contains:
$result .= ">$link_text</a>";

and replace it with:
$result .= "target=\"_blank\">$link_text</a>";

Hope this helps.
Thanks, it works :)
0 votes
I left some comments on the project page, but I'll cross-post them here too.  Great plugin!  Thanks alot.  Much preferred over the wysiwyg editor.

Just one complaint, that 'top' should be changed to 'window' in the javascript, otherwise it breaks if q2a is running in an iframe.
answered Aug 2, 2011 by NoahY2
I've replace text in the file markdown.min.js
...addEvent(top,"load"... to
...addEvent(windows,"load"... and it works fine in frame

UPD: well I'm also replace some other "top" to "window" in files markdown.min.js and in wmd.js
0 votes
One complaint I have with the markdown js (not your plugin) is that when you quote text, it truncates it all, making it quite difficult to read.  Today I managed to "fix" this, by removing the following command from markdown.min.js:

    f.wrap(a,d.wmd_env.lineLength-2),

or from wmd.js:

    command.wrap(chunk, wmd.wmd_env.lineLength - 2);

Now it just adds quote marks to the beginning, as seems reasonable.
answered Sep 18, 2011 by NoahY
0 votes
Thanks DisgruntledGoat for this wonderful plugin.

I saw this plugin working on your site, Can I use this pulgin for Q2A 1.4.2?

also will it show preview box? similar to what I can see on your site.

Is this plugin works on the custom created pages?
answered Sep 19, 2011 by ProThoughts
It doesn't make any changes at all. New posts made with the editor will have the type "markdown" in the database. There is a SQL query in the readme on github ( https://github.com/svivian/q2a-markdown-editor ) that will change the type of all old posts to markdown if you want that. It's not part of the plugin because it could break older posts.
Thanks again!