codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
378 stars 69 forks source link

Add a way to preview a comment before posting #1270

Open cellio opened 7 months ago

cellio commented 7 months ago

meta:289248

We support quite a bit of formatting in comments, even MathJax and code. Can we add a way to preview comments to avoid having to make repeated "blind" edits to fix errors?

Posts always show a preview, but comments are lighter-weight and often don't include anything fancy. I think for comments it would be fine to have to click something to see a preview, whether that's a button that produces a modal, or GitHub-style "Write" and "Preview" tabs, or something else lightweight. I think it would probably be overkill, and maybe distracting, to have the formatted version of a comment always show up below the textbox like for posts. Also, for initial comments, it would make the field for the thread title less obvious. But can we give users the option to see a rendered comment before posting, for those cases where it would help?