That’s actually something that varies from country to country.
the American style places commas and periods inside the quotation marks, even if they are not in the original material. British style (more sensibly) places unquoted periods and commas outside the quotation marks. For all other punctuation, the British and American styles are in agreement: unless the punctuation is part of the quoted material, it goes outside the quotation marks.
It’s always bothered me when writing technical documentation, that I would put the period or the comma outside of the quotes (since that’s what my English teachers always told me) but I am quoting something very specific which does not include the punctuation mark.
But when I’m not writing tech docs, I try to follow that “rule.”
That’s actually something that varies from country to country.
https://www.thepunctuationguide.com/british-versus-american-style.html
It’s always bothered me when writing technical documentation, that I would put the period or the comma outside of the quotes (since that’s what my English teachers always told me) but I am quoting something very specific which does not include the punctuation mark.
But when I’m not writing tech docs, I try to follow that “rule.”