Skip to content

Honor autoClosePairsEnabled in the square-bracket auto-close paths - #179

Open
davidwkeith wants to merge 2 commits into
nodes-app:mainfrom
Anglesite:honor-autoclose-bracket-lists
Open

Honor autoClosePairsEnabled in the square-bracket auto-close paths#179
davidwkeith wants to merge 2 commits into
nodes-app:mainfrom
Anglesite:honor-autoclose-bracket-lists

Conversation

@davidwkeith

Copy link
Copy Markdown

Summary

Both the single-[ auto-close and the Obsidian-style [[ node-bracket completion in MarkdownListHandler are bracket auto-closing, but only the single-[ path checked ListStyle.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 autoClosePairsEnabled guard 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 build
  • swift test --filter MarkdownListHandlerBracketAutoCloseTests — new coverage for both bracket paths with autoClosePairsEnabled on (default, unchanged) and off (new behavior)
  • swift test (full suite) — green aside from a pre-existing, unrelated failure in RebuildSelectionReplayTests.rebuildAppliesAutocorrectForLoadedCaret that reproduces identically on main
  • Added a CHANGELOG.md entry under [Unreleased]

davidwkeith and others added 2 commits September 4, 2026 09:17
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>
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>
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.

1 participant