What is the exact policy on Stack Overflow about inserting the poster's code into his question, given the fact that there is an external link to the code in the post?
I've tried to find an official post on the policy about inserting someone's code in his question but really haven't found anything. The only related question I found on Meta-SO is this one, but it hasn't gotten a lot of attention or responses. There is also that question that talks about it and Merlyn Morgan-Graham's answer links to the FAQ. The problem is that the FAQ doesn't not cover this issue directly. Also the latter is more about "should we close the question" instead of "is it legal to edit the code in".
Some sites like Code Review have very strict policies. You can see the following Meta post that states that it's strictly forbidden to copy code into the question there. A lot of edits are rejected there because of that. Here is an example of one edit I made when I was new on the site. Once you know about it, it does make a lot of sense. The code has to be added to the post by the OP.
On Stack Overflow, it's a bit different. There doesn't seem to be any strict policy on that. Sometimes the edit is accepted and sometimes it's rejected – it depends of the reviewers. Though if someones rejects he doesn't really have a Meta post to link to support his rejection.
Recently I've stumbled onto this edit and really wondered if that was "legal" and/or encouraged, in terms of the site policies. On Code Review this would have been rolled-back right away.