Disable text substitutions by default for all users#268
Merged
Conversation
Add a one-time migration fix that resets all text substitution settings (smart dashes, smart quotes, spelling correction, etc.) to OFF. This ensures that both new users and users who migrated from old MacDown get the correct defaults for a Markdown editor. Text substitutions break Markdown syntax: - Smart dashes convert --- to em-dash (breaks horizontal rules and tables) - Smart quotes convert straight quotes to curly (breaks code blocks) - Spelling correction can mangle technical terms The fix uses a flag (MPDidApplySubstitutionDefaultsFix) to ensure it only runs once, so subsequent explicit user choices via Edit > Substitutions are preserved. Related to #263
Contributor
Code Coverage ReportCurrent Coverage: 51.67% Coverage Details (Summary) |
1 task
schuyler
pushed a commit
that referenced
this pull request
Jan 13, 2026
This commit implements GitHub issue #269, adding: 1. **Enable checkbox/task list by default** - Added one-time migration in MPPreferences.m that enables htmlTaskList for all users who haven't explicitly set a preference (following the pattern from #268). 2. **Interactive checkboxes** - Clicking a checkbox in the preview now toggles its state in the source document: - Modified hoedown_html_patch.c to add data-checkbox-index attribute - Updated tasklist.js with click handlers using custom URL scheme - Added handleCheckboxToggle: and toggleCheckboxAtIndex:inMarkdown: methods in MPDocument.m to handle the toggle logic 3. **Comprehensive tests** - Added TDD tests covering: - Migration behavior (MPPreferencesTests.m) - Checkbox index rendering (MPMarkdownRenderingTests.m) - Toggle logic and edge cases (MPCheckboxToggleTests.m) 4. **Updated golden files** - Updated task-lists.html and mixed-complex.html to include the new data-checkbox-index attributes. Related to #269
schuyler
pushed a commit
that referenced
this pull request
Jan 25, 2026
Added comprehensive test cases for PR #268 which addresses issue #263: - Fresh installation verification (substitutions OFF by default) - Horizontal rule and table syntax preservation - Migration fix for users with bad defaults - User choice preservation after enabling substitutions - All substitution types verified (dashes, quotes, text replacement, spelling)
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
This PR adds a one-time migration fix that resets all text substitution settings to OFF for all users. This addresses issue #263 where smart dashes (and other text substitutions) break Markdown syntax.
Changes:
loadDefaultUserDefaultsinMPPreferences.mthat:MPDidApplySubstitutionDefaultsFixflagSettings disabled:
---horizontal rules and table syntax)Behavior:
Related Issue
Related to #263
Manual Testing Plan
Scenario 1: Fresh Installation
defaults delete app.macdown.macdown3000Scenario 2: Migrated User with Bad Defaults
defaults write app.macdown.macdown3000 editorAutomaticDashSubstitutionEnabled -bool YESdefaults delete app.macdown.macdown3000 MPDidApplySubstitutionDefaultsFixScenario 3: User Choices Preserved
Scenario 4: Functional Verification
---- should remain as dashes (not convert to em-dash)| Col1 | Col2 |then|---|---|- table syntax should work"text"- should remain straight quotesReview Notes