Skip to content

Allow preserving existing replacement characters - #220

Open
agammann wants to merge 1 commit into
simov:masterfrom
agammann:preserve-replacement
Open

agammann wants to merge 1 commit into
simov:masterfrom
agammann:preserve-replacement

Conversation

@agammann

Copy link
Copy Markdown

Addresses the separator collision reported in #141.

Add an opt-in preserveReplacement option so characters already equal to the chosen replacement are kept instead of being folded into surrounding whitespace. This makes step -1 become step--1 while step 1 remains step-1, and keeps 1952-- intact. The default behavior is unchanged. Document the option and add its TypeScript declaration and regression cases. This is separate from #179, which proposes preserving arbitrary characters through strict filtering.

Baseline reproduction: both step -1 and step 1 produced step-1; 1952-- produced 1952. Local verification: direct Mocha run passed all 46 tests; direct Node output confirmed the three expected cases and unchanged default; a TypeScript import using the new option compiled with tsc --noEmit; git diff --cached --check passed.

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