7

I think that most people have probably stumbled across https://stackoverflow.com/a/1732454/2191572 by now and it is quite entertaining.

One thing which I wanted to do is see in my recent stumble is the Markdown code which may or may not have been used to write the answer, but the edit button is grayed out.

Yes, I am aware that I can see the edit history or visit data.stackexchange but what if there was no edit history or, like most users of the site, not familiar with data.stackexchange?

Another facet which comes to mind is: are low-rep users allowed to edit questions at all? What if a low-rep user is trying to write a very good first question but they are not quite familiar with markdown so they wish to see how the pros do it but are not allowed to?

Basically my question boils down to:

Should all users and visitors be allowed to see the markdown source code of a question/answer any time they please?


Enter image description here

11
  • 1
    This again. Sigh :/ Commented Oct 13, 2016 at 18:19
  • 2
    @πάνταῥεῖ what again?
    – MonkeyZeus
    Commented Oct 13, 2016 at 18:19
  • @MonkeyZeus Tony the Pony :) Commented Oct 13, 2016 at 18:20
  • @MonkeyZeus Questions about that particular post are coming up every now and then. Commented Oct 13, 2016 at 18:20
  • 5
    @πάνταῥεῖ Yes, I would imagine that the regex question comes up more often than you would like but I am not fixated on that question. Trying to discuss something broader. I even provided a red box; did you see it?
    – MonkeyZeus
    Commented Oct 13, 2016 at 18:22
  • @MonkeyZeus when you say "underlying source code," I think HTML (the source of the page). Is there a good way to tweak the title and make it extra-clear you're talking about the markdown (the source of the question), not the html?
    – ssube
    Commented Oct 13, 2016 at 18:24
  • @ssube My bad, I can see how that could cause confusion. How's the new title look?
    – MonkeyZeus
    Commented Oct 13, 2016 at 18:26
  • @LucasTrzesniewski Please enlighten me, that went straight over my head :-(
    – MonkeyZeus
    Commented Oct 13, 2016 at 18:31
  • 3
    @MonkeyZeus look at the last sentence ('Tony the Pony He Comes"), it's a reference to a blog post by Jon Skeet. Commented Oct 13, 2016 at 18:33
  • @MonkeyZeus lgtm. +1
    – ssube
    Commented Oct 13, 2016 at 18:36
  • @LucasTrzesniewski LOL! Thanks!
    – MonkeyZeus
    Commented Oct 13, 2016 at 19:20

2 Answers 2

9

Actually, you can see this through the revision history, and this method works whether the question has a revision history link or not.

The Easy Situation

If the post has a revision link, this is much simpler. Click the link. On the revision you want the source of, click the "source" link.

Source link on a revision

This will show you the actual markdown source of that revision.

The Slightly More Involved Situation

As promised, this still works if there is no revision link on the post!

To get to the revision page in this case, grab the URL of the post. If the post is an answer, this is more easily done by grabbing the URL of the share link.

http://stackoverflow.com/a/1732454/2607247 is the share URL for the answer in question. We can replace the /a/ with /posts/ and the /2607247 (which is the sharing user's user id number) with /revisions. The full format is http://stackoverflow.com/posts/<postId>/revisions.

Your link will become http://stackoverflow.com/posts/1732454/revisions which will take you to the revision history, where you can once again click the "source" link, this time of the first revision.

For this meta answer, you get https://meta.stackoverflow.com/posts/335155/revisions for a working example.

The Use Cases

New users learning how to use markdown are less likely to go look at the markdown used on other posts than they are to search the help center, I would assume. There is a help center page that is linked when editing or posting that explains how to use the various bits of markdown. If you have evidence to prove this point false, please do present it. Until such time, I'm going to see this suggested use case as incredibly uncommon.

I would argue that the "curiosity" use case is also not that common. How often do you read an answer and think, "Huh, I wonder how they formatted this post" when you're browsing Stack Overflow? I would assume not that often, and less often the more you understand markdown syntax. I can often figure out now what markdown was used to format something a certain way, for example.

I don't see a lot of reason for the team to spend time making this easier when it's not too hard (though a bit hidden) in the first place, not for these use cases. If you really want this made easier, a user script should be able to do it.

3
  • 3
    My main argument is that this knowledge is not common for 98% of users.
    – MonkeyZeus
    Commented Oct 13, 2016 at 18:47
  • 2
    That argument is not what you asked in your question. You asked if all users should be able to see this markdown, and proposed a way to do so. I have shown you how to do so with the current system, regardless of the post having an edit history or not. All users can see the markdown, it's just a bit of an involved process to do it.
    – Kendra
    Commented Oct 13, 2016 at 18:49
  • Also bear in mind that there is a markdown page in the help center. If a new user can't get to the markdown of a post, they can look in the help center for how the markdown works. This is even linked to when editing a post, or when writing a question/answer. If you just want to see the markdown of a pre-existing post out of curiosity, what I would assume is a much less common issue, there is a pre-existing way to do it.
    – Kendra
    Commented Oct 13, 2016 at 18:51
3

One thing which I wanted to do is see in my recent stumble is the markdown code which may or may not have been used to write the answer, but the edit button is grayed out.

Yes that's because the post is locked and is not open to non-moderator edits. In fact, it was locked specifically for this reason. So even though you might personally use the post editor to view the markdown, that's not what the edit link is designed to do. As you have researched, the most consistent way to get the markdown source of a post is to go to the edit history and click the source link on the revision of choice.

Should all users and visitors be allowed to see the markdown source code of a question/answer any time they please?

They already can do this. I think that the additional option you add to view the markdown source is both redundant and distracting. Personally, I think you're really overestimating how many users are that interested in the markdown source of the answer on posts that they can't edit. This strikes me as over optimizing for a very uncommon use case.

Besides, even logged-off/anonymous users can go through the post's revision history by clicking the "edit {{time}}" link or directly visiting stackoverflow/posts/{{postId}}/revisions. Then to get the source of any revision:

markdown source link in revision history

Upon clicking the source link:

Source as an image

5
  • 1
    Great, lets pretend this very answer is locked, the edit button is grayed out, and there is NO REVISION HISTORY. How do I view the markdown source?
    – MonkeyZeus
    Commented Oct 13, 2016 at 18:41
  • 1
    It's still hacky, but you can url manipulate to get to the revision history. It's http://stackoverflow.com/posts/{{postId}}/revisions
    – ryanyuyu
    Commented Oct 13, 2016 at 18:45
  • 1
    Yes, I see Kendra explained this as well but I would imagine that this knowledge is not common for 98% of users.
    – MonkeyZeus
    Commented Oct 13, 2016 at 18:47
  • 2
    I also imagine that 99% of users don't care about the markdown source of a post unless they are actually able to edit it with the edit link.
    – ryanyuyu
    Commented Oct 13, 2016 at 18:49
  • 2
    Not true. Sometimes you see something 'cool' markdown-wise and want to know how it was done. Alas, it seems the community here has made up its mind that the most user-friendly way is to edit a url assuming you know how and look at revision histories. Still, thanks for the effort @MonkeyZeus, much appreciated. Commented Sep 1, 2020 at 12:03

You must log in to answer this question.

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