Automattic / Automattic/harper

TeX: False positive SentenceCapitalization when a sentence spanning multiple lines is intended

Open
#3,224 2 comments 0 reactions 0 assignees View on GitHub
bug harper-core linting tex
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

**What got flagged?**
```
\begin{abstract}
This is a perfectly
fine sentence.
\end{abstract}
```

This flags "fine" (`SentenceCapitalization`).

Interestingly, it's not flagged when I remove the indentation (the two spaces).

**Why is this incorrect?**
LaTeX (and probably also TeX?) merges all whitespace into a single space, so it's perfectly fine to have a line break followed by spaces or tabs. I believe the only exception is that a line containing only whitespace characters (or nothing) represents a paragraph break.

**Additional notes**
This may be related to #3106, which hasn't been released yet. (I'm seeing the issue on 2.0.0). But from skimming the diff in #3106, I guess #3106 doesn't solve this. /cc @jurajkl

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the LaTeX example and trace how SentenceCapitalization handles line breaks, indentation, and whitespace-only lines. Check the behavior discussed in issue #3106 as context. Done means indentation after a line break no longer produces a false positive, while whitespace-only lines still represent paragraph breaks.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, tex
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.