Skip to content

Feature Request: Character-Level Diffing Option #44

@freezpmark

Description

@freezpmark

Current Behavior
Currently, Redlines uses token-level diffing through difflib.SequenceMatcher. When comparing text with small changes (like "dinner" to "dinners"), the entire word is marked as deleted and the new word is inserted, resulting in the entire word being crossed out and rewritten.

Desired Behavior
I would like an option for character-level diffing that only highlights the specific characters that changed.

Some examples:
Original: "have dinner often."
Corrected: "have dinners often."
Current output: "have dinner dinners often."
Desired output: "have dinners often."

Original: "I want eggs also."
Corrected: "I want eggs."
Current output: "I want eggs also. eggs."
Desired output: "I want eggs also."

Note: This feature would only apply to cases where parts of words are added or removed, not both -- when words change completely. For example, in the case of "ourself" → "ourselves", the standard token replacement (crossing out and adding) would still apply.
This would make the diff more readable and precise, especially for language learning applications where small grammatical changes are common.

Image

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions