Automattic / Automattic/harper
Add support for spaced ellipses
- Dominant language
- Rust
- Stars
- 15.4k
- Forks
- 627
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 106
Description
**What problem does this solve?**
In older texts it was common for ellipses to use spaces between the dots, either with or without spaces on either side. I assume we'd mostly come across this in scanned texts?
This is quite apparent in the version of _The Great Gatsby_ Harper uses in its POS snapshot tests.
**Proposed Solution**
Probably just modify this function in `document.rs`:
```rs
fn uncached_ellipsis_pattern() -> Lrc {
let period = SequenceExpr::default().then_period();
Lrc::new(Repeating::new(Box::new(period), 2))
}
```
And probably also the `EllipsisLength` linter.
**Examples**
3 dots with a space on each side:
4 dots with a space after but not before. Probably after sentences though:
4 dots with a space after but not before. But definitely not after sentences:
**Component**
- [x] Core engine
- [ ] Plugin/Extension
- [ ] Other: _____
Contributor guide
Research direction
Start in document.rs at uncached_ellipsis_pattern and inspect the EllipsisLength linter to understand how spaced ellipses are currently detected. Run the existing POS snapshot tests, including the version of The Great Gatsby mentioned in the issue, then add coverage for the shown three- and four-dot spacing patterns. Done means the patterns are recognized consistently without breaking existing ellipsis behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100