MD027 cannot attribute a continuation line's spaces when a list item sits between two quotes
- Langage dominant
- Rust
- Étoiles
- 407
- Forks
- 12
- Merge moyen
- 5 h 45 min
- PR mergées (30 j)
- 30
Description
When a list item sits between a quote and the quote above it, MD027 cannot say
whether the spaces on a continuation line are the quote's or the item's, and
answers by not reporting them.
## Reproduction
```markdown
> - > Quoted text
> More quoted text
```
Line 2 is reported by mado 0.3.2 at `2:8` and by mdl 0.17.0, and is not reported
on the branch for #439. comrak renders the document as one paragraph, `first` and
`second` both stripped of their prefix, so the four spaces after the `>` on line 2
are not content.
The neighbouring document has to stay clean, which is why the branch leaves both
alone:
```markdown
> - > Quoted text
> Not indented
```
Here the item's content begins at column 7, which is where `Not indented` begins,
so the line carries no space of the quote's own. Reporting it was a false
positive the branch for #439 introduced and took back out.
## Why the two cannot be told apart yet
MD027 reads the markers off the line and charges the gap before each to the
marker that follows it. A gap outside the markers the quote owns is the list
item's indentation and goes unmeasured, which is what keeps the second document
clean and what loses the first: the item's indentation sits behind the marker
there rather than in front of the next one.
Telling them apart wants the item's content offset, which comrak reports as
`NodeList::padding` beside the item's own column: the legitimate prefix for a
continuation line is that offset, and anything past it is the quote's. Nothing in
the rule reads it today.
## Reach
The same gap hides an outer marker on a line that a list item's quote continues:
```markdown
> - > > a
> > b
```
`1:10` and `2:9` are reported, by 0.3.2 as well; the two spaces after the first
`>` on line 2 are not. mdl reports line 2, which both tools do, so this half is a
missing second report rather than a missing line.
Raised while fixing #439. Related: #454, which is the same question for a quote's
second and later children, and #455, for indentation before a marker.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.