q2a / question2answer

Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.
http://www.question2answer.org/
GNU General Public License v3.0
1.63k stars 627 forks source link

Allow editors to convert between different formats #331

Open gurjyot opened 8 years ago

gurjyot commented 8 years ago

I have set up Ckeditor for Answers and basic editor for comments. Now if I turn an answer to a comment and then try to edit that comment, then Ckeditor shows up for editing that comment. Instead basic editor should be shown (which is just a text box).

svivian commented 8 years ago

It's done like this by design. The problem is, you could have HTML in your answer and when you convert it to text it would have to show the HTML code which looks messy. Coupled with the fact you can have any combination of editors (e.g. Markdown for answers, CKeditor for comments) and it's impossible to automatically convert from one to another.

We may be able to partially solve this by allowing conversion functions in editor plugins. Something along the lines of $ckeditor->convertToFormat('text', $content) and each editor can decide which formats they handle.

gurjyot commented 8 years ago

I do not know what the perfect solution would be for this. So you can do whatever you think is good or if it is good the way it is now then leave it this say only.