Honor autoClosePairsEnabled in the square-bracket auto-close paths - #179
Open
davidwkeith wants to merge 2 commits into
Open
Honor autoClosePairsEnabled in the square-bracket auto-close paths#179davidwkeith wants to merge 2 commits into
davidwkeith wants to merge 2 commits into
Conversation
The Obsidian-style [[ completion and single-[ auto-close are both bracket auto-closing; embedders that edit plain Markdown source (autoClosePairsEnabled = false) expect [ to insert exactly [. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds coverage for both the single-[ and Obsidian-style [[ paths, with autoClosePairsEnabled on (default, unchanged behavior) and off (new behavior), and a CHANGELOG entry. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merged
4 tasks
davidwkeith
added a commit
to Anglesite/Anglesite
that referenced
this pull request
Sep 4, 2026
Package.swift's badbaa4b comment said "not yet upstreamed"; the patch is now nodes-app/swift-markdown-engine#179. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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
Both the single-
[auto-close and the Obsidian-style[[node-bracket completion inMarkdownListHandlerare bracket auto-closing, but only the single-[path checkedListStyle.autoClosePairsEnabled— the[[→[[]]completion fired unconditionally. An embedder that disables bracket auto-closing to edit plain Markdown source still got bracket pairs inserted underneath it through the[[path.This adds the same
autoClosePairsEnabledguard at the top of the[handling, before either bracket-completion branch runs.This came up integrating the engine into an app that edits Markdown files directly on disk (companion to #174's quote-substitution fix from the same integration).
Test plan
swift buildswift test --filter MarkdownListHandlerBracketAutoCloseTests— new coverage for both bracket paths withautoClosePairsEnabledon (default, unchanged) and off (new behavior)swift test(full suite) — green aside from a pre-existing, unrelated failure inRebuildSelectionReplayTests.rebuildAppliesAutocorrectForLoadedCaretthat reproduces identically onmainCHANGELOG.mdentry under[Unreleased]