Logical Quotation
Placing punctuation inside quotation marks only when it belonged to the quoted material.
Logical quotation, sometimes called British style, keeps the punctuation with whichever text it belongs to. A comma or period goes inside the closing mark if it was part of the original, and outside if it belongs to the surrounding sentence.
American convention differs: commas and periods go inside the closing mark regardless of origin, a habit inherited from hand-set type, where a period tucked under the quote mark was less likely to break off.
The logical style is standard in technical writing, where a stray character inside quotation marks can change what a reader types. Wikipedia adopted it for the same reason: quoted strings must be reproduced exactly.
Common mistake: mixing systems in one document. Either convention is defensible; alternating between them within a page tells readers nothing about whether a given comma was in the source.
“She described the file as "corrupted", then typed "rm -rf .".”
Keep reading the glossary
The rule — differing on either side of the Atlantic — for where the comma and period sit relative to a closing quotation mark.
A national style difference — double in American English, single in much of British English.
The British name for quotation marks — the paired punctuation used to enclose direct speech and quoted material.
Word-for-word — quoting exactly as the original was spoken or written.