Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I turn off smart quotes in Jekyll?

How do I turn off smart quotes and apostrophes in Jekyll? It is breaking my gulp spellcheck process.

I want words like doesn't to stay with a single straight quote. Instead Jekyll is converting them to smart quotes like doesnt’ and I need them to stay single quoted for spell checking.

This is what I tried in my _config.yml:

kramdown:
    smartquotes:  ["apos", "rsquo", "ldquo", "rdquo"]

I'm using kramdown.

Here is my whole config:

name: Bitcoin Bulls
markdown: kramdown
timezone: America/Detroit
highlighter: pygments
author: David Smith
safe: true
lsi: false
permalink: none

url: http://www.bitcoinbulls.net
exclude:  [CNAME, Gemfile, Gemfile.lock, '*.less', gruntfile.js, custom_css, node_modules, README.md, '*.svg', '*.docx']
include: [glyphicons-halflings-regular.svg]


kramdown:
    smart_quotes: ["rdquo", "rsquo", "ldquo", "rdquo"]


relative_permalinks: false

defaults:
  -
    scope:
      path: "" # empty string for all files
    values:
      layout: "default"
  -
    scope:
      path: "" # empty string for all files
      type: post
    values:
      layout: "post"
      is_post: true
like image 228
David Silva Smith Avatar asked Aug 31 '14 22:08

David Silva Smith


People also ask

How do I turn off smart punctuation?

Go to Settings > General > Keyboard, and toggle off “Smart Punctuation.”


1 Answers

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’
  • "quote" becomes “quote”

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: ["lsquo", "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.

like image 112
David Jacquel Avatar answered Oct 24 '22 12:10

David Jacquel