In this question I posted only the code relevant to the purpose of the question, leaving an MCVE in an external link. Then after a few comments a solution for my question came up from the users, and then I posted the whole code of the MCVE as an answer below, and I edited the answer to point at it.
Is this an acceptable procedure? I mean, even if the solution to my problem came with another user's answer, is it OK to share the whole code as an answer for future reference?
My concern is that it can be lost within other answers and/or a future user can't easily compare the starting code and the improved code.
On the other hand, my concern is that posting the code on bottom the question with an edit may lenghten the question itself too much so that it worsens readability.