Skip to content

Fix task description truncated when space follows period#734

Open
mitre88 wants to merge 1 commit intoruby:masterfrom
mitre88:fix/task-description-space-after-period
Open

Fix task description truncated when space follows period#734
mitre88 wants to merge 1 commit intoruby:masterfrom
mitre88:fix/task-description-space-after-period

Conversation

@mitre88
Copy link
Copy Markdown

@mitre88 mitre88 commented May 5, 2026

The first_sentence method was incorrectly splitting on period followed by any whitespace, which caused descriptions like 'foo. bar' to be truncated to just 'foo'.

For example:

  • 'foo. bar' was truncated to 'foo' (bug)
  • 'foo.bar' remained 'foo.bar' (correct)
  • 'This is a task. It has more.' became 'This is a task' (correct)

The new regex uses a positive lookbehind to match sentence terminators (. ! ?) followed by one or more spaces, which correctly handles:

  • Multiple sentences separated by spaces
  • Decimal points (e.g. doesn't end a sentence)
  • Periods in abbreviations
  • Cases where a period is followed by a newline instead of space

The first_sentence method was incorrectly splitting on period followed
by any whitespace, which caused descriptions like 'foo. bar' to be
truncated to just 'foo'.

For example:
- 'foo. bar' was truncated to 'foo' (bug)
- 'foo.bar' remained 'foo.bar' (correct)
- 'This is a task. It has more.' became 'This is a task' (correct)

The new regex uses a positive lookbehind to match sentence terminators
(. ! ?) followed by one or more spaces, which correctly handles:
- Multiple sentences separated by spaces
- Decimal points (e.g. doesn't end a sentence)
- Periods in abbreviations
- Cases where a period is followed by a newline instead of space
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