Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 153 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I am editing a question and would like to preview my changes prior to saving. I can see how the page will look and can optionally hide this preview.

However, I would like to see the actual changes that I made; that is, the diff with the red struck out parts and the green newly inserted parts (as is shown when you are comparing versions). A side-by-side and side-by-side markdown preview would be helpful too.

To make sure the basic usage doesn't change, we could by default list a normal preview, like it is now. There could be buttons to change to inline differences, side-by-side differences and side-by-side markdown differences. This could look the same as it does when looking at revisions.

This would make it easier to see the changes, hence preventing an additional edit step. This also helps you write the edit summary, so that you don't forget to mention an important change you made.

share|improve this question
I'm not sure what you mean; what are you looking for that the preview right below the edit box doesn't provide? – Michael Mrozek Mar 18 '12 at 20:24
I would like to see the diff - with green and red that I can see after I saved the edit – false Mar 18 '12 at 20:26
@false: Can you provide the reason you feel this is important? The diff is not what matters, the final outcome is all that does. What do you mean by "to prevent an additional edit step"? – Wesley Murch Mar 18 '12 at 20:30
Ah, I guess that could be useful, to see if you've accidentally deleted something and forgotten about it – Michael Mrozek Mar 18 '12 at 20:32
@Madmartigan: If edits are a little bit larger though trivial (like name formatting that otherwise would make the text less readable), this feature would be very useful. – false Mar 18 '12 at 20:37
(Nice edit, @Adel!) – Arjan Mar 18 '12 at 20:55
@Camil As you deleted a duplicate question. I suggest you that instead of deleting, you should vote/flag it to close. So that feature users may get link of this question from your question. :) – hims056 Apr 2 '13 at 7:03
@Camil I agree with what hims056 said, didn't mean for you to delete your post and even upvoted it. Nothing wrong with dupes. – Shadow Wizard Apr 2 '13 at 7:22
@hims056 Sorry, but I can't find the post anymore. Shall I just post a new one? – Camil Staps Apr 2 '13 at 8:13
@CamilStaps - Nah. Don't post duplicate question once you find the original one. Just remember it in the future. :) – hims056 Apr 2 '13 at 8:15
@hims056 Okay, thanks! – Camil Staps Apr 2 '13 at 8:17
@CamilStaps: Your edit is exactly what I thought of today! – false Apr 3 '13 at 8:58
This could do with a pretty picture :) – hayd Apr 3 '13 at 9:14
@hayden: Only hand-drawn pictures, please! – false Apr 3 '13 at 9:23

I think this is a good idea. I don't have to explain what the advantages would be; the question covers that enough, I think. There are two things I'd like to do with the answer: giving an optional design and discussing the developer's pain to create this.

The design

It could look like this (I used the Electrical Engineering site for these images):

enter image description here

As you can see, I added some options directly above the preview: inline, side-by-side and side-by-side markdown. This is exactly the same as when you're viewing revisions. Because I added a normal option, you won't lose any features you have now!

Now, let's see how it looks when viewing it with, for example, the side-by-side view:

enter image description here

The developers

I assume the revision change views are done with the pecl Text-Diff package or its newer version. That means the changes are calculated at the server. That means, there are three options (I think):

  • Make or get a JavaScript version of the package. There appears to be something, but I'm not sure. It might always look a bit different then the revisions, but that wouldn't be a huge problem.

  • Continuously use Ajax calls to the server, like every 10 or 15 seconds. I wouldn't recommend it, it would increase the server load a lot, probably.

  • Use an Ajax call, but on demand. So only call the server when someone actually clicks on a side-by-side button. I (and the OP) think this is your best bet, but who am I.


I don't have to say why this is a good idea, the arguments are explained in the question already.

Given my design ideas, the user won't lose the preview option he has now (just the new text). The design idea I gave only adds features, without really changing an existing feature.

I'm not sure how much it will take to integrate the ideas. Since the revision changes are calculated on the server and the standard preview is pure JavaScript (I think), it might get tricky.

share|improve this answer
#3, but only on demand, if it is a diff. – false Apr 8 '13 at 17:30
... and delete automatically the diff if it is no longer current – false Apr 8 '13 at 17:31
@false useful addition! – Camil Staps Apr 8 '13 at 17:31
Pecl extension on a .net webapp? Nope. – Johannes Kuhn Jun 7 '13 at 18:24
This needs to happen. – Ed Cottrell Mar 10 '14 at 21:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .