Tutorials 24 min read

Your Keyboard Rewrites the Markdown You Type — What Smart Punctuation Does to Front Matter, Tables and Links

MMNMNOTE
smart-punctuationsmart-quotesmarkdownyamlfront-matteriosipadosmacostypographytables

Apple's Smart Punctuation replaces the straight quotes and hyphens you type with curly quotes and dashes, in every app that does not switch it off. Markdown and YAML read only the straight characters. So a --- that opens front matter stops opening it, a table loses its delimiter row, and a quoted title keeps its quotes as text.12

Apple says so on its own help page. The Pages guide for iPhone describes the conversion — "Pages automatically converts double hyphens (--) to dashes (—) and converts straight quotation marks to curly quotation marks as you type" — and then adds a line that reaches well past Pages: "Note: This setting applies to other apps on your device that you use to enter text."2

A note app is one of those other apps — unless it opts out.

The question keeps coming back. On the Obsidian forum, "Convert smart/curly quotes to straight" had 1,820 views on 29 November 2026, and a thread titled "Smart quotes issue in the macOS version of Obsidian" was opened on 10 October 2026.3

What follows is ten lines typed the way Smart Punctuation leaves them, and what a YAML parser, a Markdown parser and Python made of each; why the specifications read only straight characters; where the setting lives on iPhone, iPad and Mac; how to keep curly quotes in prose without losing them in syntax; and a search-and-repair for notes already typed.


What Smart Punctuation changes, in Apple's own words

Smart Punctuation changes two things as you type: straight quotation marks become curly ones, and runs of hyphens become dashes. On iPhone and iPad it is one switch for every app that does not opt out, onscreen and external keyboards alike. On the Mac it is "Use smart quotes and dashes", which Apple says is not available in all apps.245

The iPad guide is explicit about hardware: "These settings apply to your onscreen keyboard and external keyboard."4 A Bluetooth keyboard on an iPad does not bypass the switch.

The quote swap is the same everywhere. The dash swap is where Apple's pages disagree with each other.

Apple's developer documentation for the iOS text system says the smart-dash setting turns "two hyphens into an en-dash and three hyphens into an em-dash."6 So, by that page, -- becomes – (U+2013) and --- becomes a single — (U+2014).

The Pages guide for iPhone says double hyphens become "dashes (—)" — the em dash glyph, not the en dash.2 The Mac guide says the setting converts "double hyphens to em dashes (—)."5 On a Mac, then, three hyphens would likely become an em dash followed by a hyphen, —- — an inference from that sentence, not a typed result.

Both variants break the same things, as the next section shows. What matters is that the line no longer holds three hyphens.

Ten lines typed, and what the parsers made of them

Ten lines of Markdown, YAML and code were written with the characters Smart Punctuation produces and run through PyYAML, markdown-it-py and Python on 29 November 2026. Every one changed meaning. Front matter disappeared, a table became a paragraph, a title was cut short, and one quoted value stopped the front matter loading at all.1

The test typed the substituted characters directly. It did not drive a real keyboard, so which characters a current iPhone or Mac produces comes from Apple's documentation above, not from a device. Both dash variants — — and —- — were run wherever a dash was involved.

You typedSmart Punctuation givesResult (observed)
title: "Trip notes"title: “Trip notes”the title is “Trip notes” — quotes included
tags: ["travel", "2026"]tags: [“travel”, “2026”]the tags are “travel” and “2026”
title: "Trip: day 1"title: “Trip: day 1”parse error — the front matter does not load
title: "Draft #2"title: “Draft #2”the title is “Draft — the rest is gone
front matter fenced by ---fenced by — or —-no front matter — metadata is empty
table row |---|---||—|—| or |—-|—-|no table — one paragraph of pipes
[guide](https://example.com "Guide")… “Guide”)no link — literal brackets
--- between sections— or —-no rule — the dash prints as text
Heading over a --- lineHeading over —no heading — a two-line paragraph
print("hi"), copied out to runprint(“hi”)Python refuses to run it

The versions were Python 3.14.4, PyYAML 6.0.3, markdown-it-py 3.0.0 with tables enabled, its front-matter plugin from mdit-py-plugins 0.7.0, and python-frontmatter 1.3.0.1

None of these is a bug in a parser. Each one is reading the specification correctly.

The worst case: the front-matter fence

Front matter is the YAML block between two lines of three hyphens at the top of a note. When Smart Punctuation turns those lines into — or —-, the block is no longer front matter at all. In the test, both front-matter readers found nothing — every field gone from the metadata.1

This is the row the other failures sit inside. A mis-quoted title is one wrong value. A rewritten fence is every value — title, tags, dates, aliases — moved out of the metadata and into the body as ordinary text.

Here is a block as typed on a keyboard with Smart Punctuation on:

—
title: Trip
—

And what two readers reported:

markdown-it-py + front_matter plugin: tokens=['paragraph_open']   (no front_matter token)
python-frontmatter:                   metadata={}

The same block with straight hyphens gave a front_matter token and {'title': 'Trip'}.1 The variant —- gave the same empty result as —.

Anything that reads a note's properties reads them from this block. Tag lists, publish dates, a static-site generator's layout field — none of them exists once the fence is gone, and nothing raises an error to say so.

Three hyphens carry more than front matter. The meaning of --- depends on where it sits, and an earlier post on Markdown's whitespace rules, Markdown Throws Away Your Extra Spaces, shows how much a Markdown parser decides from a few characters at the start of a line.7

Curly quotes inside YAML: kept, broken, or cut short

YAML's quoted strings start and end with the straight " character. A curly quote is not that character, so YAML reads “Trip notes” as an unquoted value whose text happens to begin and end with curly quotes. Three outcomes follow: the quotes stay in the value, the file fails to parse, or the value is cut short.18

The YAML 1.2.2 specification defines the quoted style in one line: "The double-quoted style is specified by surrounding “"” indicators."8 Only the straight mark counts.

The first outcome is quiet. The title is “Trip notes”, not Trip notes. A tag list fares worse:

tags: ["travel", "2026"]   ->  ['travel', '2026']
tags: [“travel”, “2026”]   ->  ['“travel”', '“2026”']

The second pair are different tags.1 A search for the tag travel does not match “travel”.

The other two outcomes come from one sentence of the specification: "Plain scalars must never contain the “: ” and “ #” character combinations. Such combinations would cause ambiguity with mapping key/value pairs and comments."8

A title with a colon in it hits the first combination:

title: “Trip: day 1”
ScannerError: mapping values are not allowed here

That error stops the whole block from loading, not just the one line.1

A title with a hash in it hits the second:

title: “Draft #2”   ->  {'title': '“Draft'}

Everything from # onward became a comment. No error, no warning — the title is now “Draft.1

Straight quotes exist in YAML for exactly these cases. A value with a colon or a hash is the one place a writer reaches for quotes, and it is the place curly quotes do the most damage.

Four Markdown constructs depend on straight characters by definition. A table's delimiter row must contain hyphens; a thematic break and a setext heading underline need three or more hyphens; a link title sits between straight quotes. In the test, every one of them failed once Smart Punctuation's characters replaced the originals.1910

The GitHub Flavored Markdown specification defines the table's second row narrowly: "The delimiter row consists of cells whose only content are hyphens (-), and optionally, a leading or trailing colon (:), or both, to indicate left, right, or center alignment respectively."10

An em dash is not a hyphen. The test table:

| a | b |
|—|—|
| 1 | 2 |

markdown-it-py rendered it as a single paragraph — the pipes printed as text. The —- variant did the same.1

The CommonMark 0.31.2 specification sets the rule for a horizontal line: "a sequence of three or more matching -, _, or * characters".9 A lone — is one character, and not a matching one. It printed as text between two paragraphs, and the same line under a heading left a two-line paragraph instead of a second-level heading.1

Link titles are specified the same way: "a sequence of zero or more characters between straight double-quote characters".9 The specification itself says straight.

[guide](https://example.com “Guide”)

That line rendered as literal text, brackets and all — no link.1 A link without a title survives, because nothing in it is a quote or a dash.

Code you copy out of a note

Code blocks in a note are often written to be copied somewhere else — a terminal, a script, a config file. If Smart Punctuation was on when the code was typed, the quotes inside it are curly, and most programming languages reject them. In the test, Python refused a one-line print statement.1

print(“hi”)
SyntaxError: invalid character '“' (U+201C)

The same line with straight quotes compiled.1 Any command or config file copied out of a note deserves the same check.

The error names the character by its code point, U+201C. Curly quotes and dashes are ordinary Unicode characters — the left double quote, the en dash, the em dash — stored as three bytes each in UTF-8. What that means for search and storage is covered in Why Your Notes Show Garbled Characters.11

Why some apps do it and some do not

On iPhone and iPad, Smart Punctuation is a system default that each app's text field inherits unless the app switches it off. Apple's developer documentation gives every text field a smart-quotes and a smart-dashes setting. The default enables smart quotes depending on the keyboard type, and email and password fields are already exempt.1213

The developer page states the purpose of the setting: "Use this property to configure whether UIKit replaces straight apostrophes and quotation marks with region-specific glyphs."12

The default is described on its own page: "This option selectively enables the smart quote behavior based on the keyboard type. For example, smart quotes are disabled for email address and password keyboards."13

That is the mechanism behind a common report — the same keyboard converts in one app and not in another. Each app decides for its own text fields.

On the Mac, the system setting is a default, and Apple notes the limit: "Text replacements, smart quotes and dashes, and smart links aren’t available in all apps."5 Apple's guide also shows an Edit > Substitutions menu inside apps, for per-app substitution settings.

A forum thread from October 2026 shows the per-app result. A user with a Chinese-language Mac reported that the system's smart-quote style worked in Apple Notes and Bear, while another app's Edit-menu setting gave a different quote style.14

This post does not say which note apps switch the feature off. That depends on each app's code and version, and none was tested.

One more caution before blaming the keyboard. In a 2022 forum thread about two hyphens turning into a dash, a reply suspected the phone; the person who asked later wrote, "turns out it was the latex suite plugin which was doing the coversions. easy fix." [sic]15 An editor plugin can do the same substitution.

Where to turn it off on iPhone, iPad and Mac

On iPhone and iPad, the switch is Settings > General > Keyboard > Smart Punctuation, covering onscreen and external keyboards in every app that does not opt out. On the Mac, it is System Settings > Keyboard > Text Input > Edit, then "Use smart quotes and dashes". Some apps add their own toggle under Edit > Substitutions.24514

Apple's iPhone wording, from the Pages guide: "Tap Settings on the Home Screen, then tap General. Tap Keyboard, then tap Smart Punctuation."2

On the Mac, Apple's guide reads: "choose Apple menu > System Settings, then click Keyboard in the sidebar," followed by "Go to Text Input, then click Edit. Turn on “Use smart quotes and dashes.”" — switch it off instead to stop the conversion.5

DeviceWhereApplies toSource
iPhone, iPadSettings > General > Keyboard > Smart Punctuationevery app that does not opt out; onscreen and external keyboardsApple Pages and iPad guides
MacSystem Settings > Keyboard > Text Input > Edit > "Use smart quotes and dashes"the system default; "aren’t available in all apps"Apple Mac guide
Mac, one appEdit > Substitutions, where the app offers Smart Quotes and Smart Dashesthat appApple Mac guide (menu); forum report (Smart Quotes item)
Android, Windows—not tested—

The Mac's Edit > Substitutions > Show Substitutions panel has a Replace in Selection button. Apple describes it as the way "To apply smart quotes and dashes to existing text" — it curls straight quotes; it does not straighten curly ones.5

Android keyboards were not tested for this post, and no claim is made about them either way.

Keep curly quotes in prose, straight characters in syntax

Turning Smart Punctuation off is not the only answer. Many writers want curly quotes in their prose, and they have a point. The split that works is straight characters in syntax — front matter, tables, rules, link titles, code — and curly quotes in prose, made either by the renderer or by the keyboard with a cleanup pass afterwards.1617

The demand runs both ways. The forum thread "Toggle for smart quotes" — a request for the feature — had 7,700 views on 29 November 2026, against 1,820 for the thread asking to straighten them.3

A user in the straightening thread put the other side: "I strongly prefer typographic quotation marks to straight ones in prose".18

Even inside the request for smart quotes, one user named the cost. Tian wrote in October 2020: "Smart quotes looks nice, but could cause issues with the “find and replace” / regex: e.g.: find Tian's suggestion may not return a hit for Tian’s suggestion".16

Option one is the renderer. Type straight quotes and hyphens, and let the export tool curl them on the way out. Smart Quotes, Real Dashes, and the Typography Your Notes Lose in Plain Text makes that case and shows how pandoc's smart extension does it.17 That post also suggests turning smart quotes on in an editor — sound advice for prose, and the reason this one exists for syntax.

Option two is to keep Smart Punctuation on and repair syntax lines afterwards, with the commands below. It suits someone who writes mostly prose on a phone and adds front matter or a table now and then.

Option three is to switch it off for the device you write Markdown on. The cost is typing " in prose, too.

Turning it off does not fix notes already typed

Switching Smart Punctuation off changes only what you type next. Apple's Pages guide says so: "Changing the setting doesn’t affect existing hyphens and dashes in your document, only new text that you type." Notes already typed keep their curly quotes and dashes until someone finds and replaces them.2

Three commands below find the damage and preview a repair. They were run on 29 November 2026 on a test note, with perl 5.40.1 and ugrep 7.8.4 standing in for grep.1 Run them from the top of a notes folder.

Find notes with a line that is only dashes — a broken fence, rule or heading underline:

grep -rlE '^[—–][—–-]*$' --include=*.md .

Find property lines with curly quotes in them:

grep -rnE '^[a-zA-Z_]+: .*[“”‘’]' --include=*.md .

Preview a repair. This prints the fixed note without changing the file:

perl -CSD -Mutf8 -pe '
  s/^[—–][—–-]*[ \t]*$/---/;
  s/[—–]+-*/---/g if /^[ \t]*\|?[ \t]*:?[—–-]+:?[ \t]*(\|[ \t]*:?[—–-]+:?[ \t]*)+\|?[ \t]*$/;
  if (($. == 1 && /^---$/) .. (/^---$/ && $. > 1)) { tr/“”‘’/""\x27\x27/ }
' note.md

The three lines do three jobs. The first restores any line made only of dashes to ---. The second fixes table delimiter rows, keeping alignment colons. The third straightens quotes only between the opening and closing fence, and only when the note's first line is a fence — prose quotes are left alone, including in a note with no front matter.

On the test note, the repaired front matter loaded as {'title': 'Trip: day 1', 'tags': ['travel', '2026'], 'note': "It's fine"}, the table rendered, the rule came back, and the prose line kept its curly quotes.1

Two limits. The quote fix covers front matter only, not link titles or code blocks — check those by eye. And a straightened single-quoted value with an apostrophe inside, such as 'Tian's', is itself invalid YAML; the parser will say so. Add -i only after reading the preview.

What was tested, and what was only read

The parser results were observed: ten inputs run through PyYAML, markdown-it-py with tables and front matter, python-frontmatter and Python on 29 November 2026. The keyboard behaviour was read from Apple's documentation, not typed on a device. Android and Windows were not tested, and no note app's setting was checked.1

The dash type is the open question. Apple's developer page says two hyphens become an en dash on iOS; its Pages guide shows an em dash; its Mac guide says em dash.256 Every dash row in the test failed with either character, so the advice does not depend on which is right.

The repair commands were run once, on one test note.

Curly quotes also arrive by paste. The person who opened the straightening thread wrote that the text "often originates in Microsoft Word or similar, which commit the crime of Smart Quotes."18 The repair commands work the same whatever the source.

Apple's help pages change. The Pages guide's address already changed once, and the wording here was read on 29 November 2026.2 The forum view counts were read that day and will move.3

Frequently Asked Questions

Why does my iPhone turn two dashes into a long dash? That is Smart Punctuation. Apple's developer documentation says it turns two hyphens into an en dash and three into an em dash; the Pages guide for iPhone shows an em dash for two. Either way the hyphens are gone. Switch it off under Settings > General > Keyboard > Smart Punctuation.

How do I turn off smart quotes on iPhone or iPad? Open Settings > General > Keyboard and switch off Smart Punctuation. Apple says the setting applies to other apps you type in, and on iPad to both the onscreen and an external keyboard. It turns off curly quotes and automatic dashes together, and it affects only new typing, not text already in your notes.

How do I turn off smart quotes on a Mac? Choose Apple menu > System Settings > Keyboard, go to Text Input, click Edit, and switch off "Use smart quotes and dashes". Apple notes the feature is not available in all apps, and some apps have their own toggle under Edit > Substitutions. Check that menu in the app you write Markdown in.

Why is my YAML front matter not working when I edit on my phone? Smart Punctuation probably changed its characters. If the --- lines became —, the block is no longer front matter and every property disappears. If straight quotes became curly ones, values keep the quotes as text, a value with a colon fails to parse, and a value with # is cut short. Retype the characters straight.

Why did my Markdown table stop rendering? The delimiter row under the header must contain hyphens. Smart Punctuation turns --- into an em dash, and the GitHub Flavored Markdown specification accepts only hyphens and colons in that row. In a 29 November 2026 test, a table with |—|—| rendered as one paragraph of pipes. Replace the dashes with ---.

Will turning off Smart Punctuation fix my old notes? No. Apple's guide says changing the setting does not affect existing dashes, only new text you type. Old notes keep their curly quotes and dashes until you replace them. Search for lines made only of dashes and for property lines with curly quotes, then straighten the characters in those syntax lines.

Can I keep curly quotes in prose but not in Markdown syntax? Yes. Either type straight quotes everywhere and let your export tool, such as pandoc with its smart extension, curl them on output, or keep Smart Punctuation on and straighten syntax lines afterwards. Front matter, table delimiter rows, rules, link titles and code need the straight characters; prose does not.


The keyboard was built for sentences — and a note's front matter is not one.


mnmnote.com keeps notes as plain Markdown on your own device — which is why the characters in a syntax line are worth a second look before you rely on them.

Footnotes

  1. MNMNOTE, test run, 29 November 2026. Python 3.14.4, PyYAML 6.0.3, markdown-it-py 3.0.0 (commonmark with tables), mdit-py-plugins 0.7.0 (front_matter), python-frontmatter 1.3.0. Inputs typed with the substituted characters directly; no keyboard was driven. Repair commands run on a test note with perl 5.40.1 and ugrep 7.8.4. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14 ↩15 ↩16 ↩17 ↩18

  2. Apple, "Format hyphens, dashes, and quotation marks in Pages on iPhone," Pages User Guide for iPhone. https://support.apple.com/guide/pages-iphone/format-hyphens-dashes-and-quotation-marks-tanad45f9cce/ios Accessed 2026-11-29. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9

  3. Obsidian Forum, views field read 29 November 2026: "Convert smart/curly quotes to straight" (topic 40663, opened 21 July 2022) 1,820; "Toggle for smart quotes" (3924, opened 1 August 2020) 7,700; "Smart quotes issue in the macOS version of Obsidian" (119296, opened 10 October 2026) 85. https://forum.obsidian.md/t/40663.json and the same path for each topic number. ↩ ↩2 ↩3

  4. Apple, "Change typing assistance options for an Apple external keyboard with iPad," iPad User Guide. https://support.apple.com/guide/ipad/change-typing-assistance-options-ipad393debe3/ipados Accessed 2026-11-29. ↩ ↩2 ↩3

  5. Apple, "Replace text and punctuation in documents on Mac," Mac User Guide. https://support.apple.com/guide/mac-help/replace-text-punctuation-documents-mac-mh35735/mac Accessed 2026-11-29. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7

  6. Apple Developer, UITextInputTraits.smartDashesType. https://developer.apple.com/documentation/uikit/uitextinputtraits/smartdashestype Accessed 2026-11-29. ↩ ↩2

  7. MNMNOTE, "Markdown Throws Away Your Extra Spaces — What Survives an Indent, a Tab and a Blank Line, Measured in Six Renderers." https://blog.mnmnote.com/posts/markdown-throws-away-your-extra-spaces ↩

  8. YAML Ain't Markup Language, version 1.2.2, §7.3.1 "Double-Quoted Style" and §7.3.3 "Plain Style." https://yaml.org/spec/1.2.2/ Accessed 2026-11-29. ↩ ↩2 ↩3

  9. CommonMark Spec, version 0.31.2, §4.1 "Thematic breaks" and §6.3 "Links" (link title). https://spec.commonmark.org/0.31.2/ Accessed 2026-11-29. ↩ ↩2 ↩3

  10. GitHub Flavored Markdown Spec, §4.10 "Tables (extension)." https://github.github.com/gfm/ Accessed 2026-11-29. ↩ ↩2

  11. MNMNOTE, "Why Your Notes Show Garbled Characters: What 'Plain Text' Actually Means at the Byte Level." https://blog.mnmnote.com/posts/what-plain-text-actually-means-encoding ↩

  12. Apple Developer, UITextInputTraits.smartQuotesType. https://developer.apple.com/documentation/uikit/uitextinputtraits/smartquotestype Accessed 2026-11-29. ↩ ↩2

  13. Apple Developer, UITextSmartQuotesType.default. https://developer.apple.com/documentation/uikit/uitextsmartquotestype/default Accessed 2026-11-29. ↩ ↩2

  14. SuperCICI, "Smart quotes issue in the macOS version of Obsidian," Obsidian Forum, 10 October 2026. https://forum.obsidian.md/t/119296 ↩ ↩2

  15. ksdavidc, "I don't have smart typography installed but still two dashes are converting to en-dashes," Obsidian Forum, 4 July 2022. https://forum.obsidian.md/t/39855 ↩

  16. tian, reply in "Toggle for smart quotes," Obsidian Forum, 19 October 2020. https://forum.obsidian.md/t/toggle-for-smart-quotes/3924 ↩ ↩2

  17. MNMNOTE, "Smart Quotes, Real Dashes, and the Typography Your Notes Lose in Plain Text." https://blog.mnmnote.com/posts/smart-quotes-and-the-typography-your-notes-lose-in-plain-text ↩ ↩2

  18. robertandrews and Synchronicity, "Convert smart/curly quotes to straight," Obsidian Forum, 21–22 July 2022. https://forum.obsidian.md/t/convert-smart-curly-quotes-to-straight/40663 ↩ ↩2