1 回答
The underscore in smart_quotes
is missing and the second array item needs to be apos
to completely turn off smart-quotes for apostrophes.
kramdown:
smart_quotes: ["apos", "apos", "ldquo", "rdquo"]
To turn off smart-quotes for both apostrophes/single-quotes and double quotes, use this:
kramdown:
smart_quotes: ["apos", "apos", "quot", "quot"]
That's what is know as the "Programmer's world compliant config".
More details:
By default kramdown transforms apos and quot into typographic quotes. That is:
- 'apostrophe' becomes ‘apostrophe’</li>
- "quote" becomes “quote”</li>
The default config provides guidance:
kramdown:
# smart_quotes:
#
# first parameter : how an opening apostrophe is transformed
# or apostrophe like in "I'm"
# default : ' -> ‘ (lsquo)
# apos : ' -> '
#
# second parameter : how a closing apostrophe is transformed
# default : ' -> ’ (rsquo)
# apos : ' -> '
#
# third parameter : how an opening double quote is transformed
# default : " -> “ (ldquo)
# quot : " -> "
#
# fourth parameter : how a closing double quote is transformed
# default : " -> ” (rdquo)
# quot : " -> "
#
# Default kramdown config
# smart_quotes: ["rdquo", "rsquo", "ldquo", "rdquo"]
#
# Programmer's world compliant config :
# smart_quotes: ["apos", "apos", "quot", "quot"]
Where:
- quot = " : neutral quotation mark
- apos = ' : apostrophe like in I'm
- lsquo = ‘ : typographic opening single quotation mark
- rsquo = ’ : typographic closing single quotation mark
- ldquo = “ : typographic opening double quotation mark
- rdquo = ” : typographic closing double quotation mark
Kramdown's documentation provides other options that may be of interest. The Wikipedia Quotation Mark page provides lots of details on the complications of interpretation and how things changed when Unicode was introduced.