punct-006 should GuidesAPI docsMarketingBlog Use straight quotation marks in code samples and code font regardless of the convention used in body text.
Quotation marks set off quoted text and literal values, and in code they are syntax. This page covers how to write them in body text and in code, and where the punctuation around them goes.
punct-006 should GuidesAPI docsMarketingBlog Use straight quotation marks in code samples and code font regardless of the convention used in body text.
Examples
print("Hello")print(“Hello”)Rationale
Programming languages and shells treat curly quotation marks as different characters or invalid syntax. Code copied with a curly quotation mark can fail.
punct-007 should GuidesAPI docsMarketingBlog Place periods and commas inside closing quotation marks in body text.
Examples
Rationale
Placing periods and commas inside closing quotation marks follows American English convention and keeps body text consistent.
punct-008 should GuidesAPI docsMarketingBlog When a literal string or keyword is in quotation marks, place any surrounding punctuation outside the quotation marks.
Examples
Rationale
When punctuation belongs to the sentence rather than the quoted literal, placing it outside the quotation marks shows that it isn’t part of the value.
punct-022 should GuidesAPI docsMarketingBlog Don’t use single quotation marks in body text except when nesting a quotation inside another quotation or in code examples that require them.
Examples
Rationale
Double quotation marks distinguish quoted text from apostrophes. Single quotation marks remain available for a quotation inside another quotation and for code that requires them.