Skip to content

Make automatic quote substitution configurable - #174

Closed
davidwkeith wants to merge 2 commits into
nodes-app:mainfrom
Anglesite:upstream-quote-substitution
Closed

davidwkeith wants to merge 2 commits into
nodes-app:mainfrom
Anglesite:upstream-quote-substitution

Conversation

@davidwkeith

Copy link
Copy Markdown

Summary

Adds SpellCheckingPolicy.automaticQuoteSubstitution, mirroring
NSTextView.isAutomaticQuoteSubstitutionEnabled alongside the existing
continuousSpellChecking / grammarChecking / automaticSpellingCorrection
toggles. Previously isAutomaticQuoteSubstitutionEnabled was hard-coded to
true in NativeTextViewWrapper and in the autocorrect suppress-zone
restore path, with no way for an embedder to turn it off.

Some Markdown sources need straight quotes preserved throughout — frontmatter,
code-adjacent prose, anywhere automatic curly-quote substitution would
silently corrupt the source text. This came up integrating the engine into
an app that edits Markdown files directly on disk.

Defaults to true, so existing embedders see no behavior change.

Test plan

  • swift build
  • swift test --filter SpellCheckingPolicyTests — new coverage for the
    default value and for setting it independently of the other toggles
  • Added a CHANGELOG.md entry under [Unreleased]

Adds SpellCheckingPolicy.automaticQuoteSubstitution (default true — behavior
unchanged for existing embedders). Markdown-source embedders can now keep
straight quotes; previously isAutomaticQuoteSubstitutionEnabled was hard-coded
on in NativeTextViewWrapper and the autocorrect suppress-zone restore path.
Add default-value and custom-init coverage, and a CHANGELOG entry, for
the automaticQuoteSubstitution toggle.
davidwkeith added a commit to Anglesite/Anglesite that referenced this pull request Sep 3, 2026
…1841)

The comment only documented one of the fork's two patches on top of
v0.10.0. Records both, the upstream PR for the quote-substitution
patch (nodes-app/swift-markdown-engine#174), the drop condition, and
the deliberate-bump rebase policy.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@luca-chen198

Copy link
Copy Markdown
Member

Closing in favour of #189, which adds the same SpellCheckingPolicy.automaticQuoteSubstitution and also keeps the Smart Quotes menu toggle across caret moves — thanks for raising it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants