In American English (and in some cases for British English), punctuation following a bit of quoted text is traditionally placed inside the quotation. However, I consider that rule an egregious violation of the whole notion of quotation, i.e. an obvious bug in the English language. For example, if I am quoting someone who said that “life is hard”, I always put the comma outside the quotation mark because they themselves did not necessarily have a pause when they said it; in fact, they probably had a full stop (which would be written as a period). Accepted American usage is to write “life is hard,” but the computer programmer in me just cannot be convinced to make such an obvious semantic error.
Dr. James A. Bednar. Tips for Academic Writing and Other Formal Writing