Fix smart quote substitution causing unwanted characters#289
Merged
Conversation
When smart quote substitution is enabled, defer handling of quote characters to macOS instead of using custom matching-pair logic. This prevents the conflict that was causing extra characters to be inserted and corrupting the undo stack. Related to #285
- Fix header comment in MPSmartQuoteTests.m to use 'MacDown 3000' - Update test_coverage_improvement_plan.md to include new test file Related to #285
Contributor
Code Coverage ReportCurrent Coverage: 53.19% Coverage Details (Summary) |
schuyler
pushed a commit
that referenced
this pull request
Jan 24, 2026
Comprehensive testing plan covering all changes since v3000.0.3: - Smart quote substitution fix (#289) - Editor jumping when typing at end of long documents (#288) - New document window positioning (#286) - Graphviz/Mermaid button positioning in Compilation Settings (#280) - Adjacent shortcut-style links rendering (#275) Includes regression testing checklist for core functionality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the smart quote substitution bug where typing a closing quotation mark would insert extra unwanted characters, and using undo (Cmd+Z) would make it worse.
Root cause: The custom matching-pair autocomplete code was conflicting with macOS's built-in smart quote substitution. When smart quotes were enabled, the custom code tried to "mimic" smart quotes but only handled opening quotes, not closing quotes.
Fix: When smart quote substitution is enabled and the user types
"or', the custom code now returns early and defers to macOS's native smart quote handling. This eliminates the conflict.Related Issue
Related to #285
Changes
Manual Testing Plan
Setup
Key Test Scenarios
"hello""test", then Cmd+Z repeatedlyShe said "hello" and "goodbye"It's a 'test'"""inserted (regression test)(,[,{Edge Cases
„...", French«...»)