akiomik / akiomik/mado

MD027 cannot attribute a continuation line's spaces when a list item sits between two quotes

未关闭
#456 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Rust
星标
409
派生
12
平均合并
5 小时 45 分钟
30 天内合并 PR
30

描述

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.

贡献指南

打开贡献指南

调研方向

Start at the MD027 rule and inspect how it reads marker gaps, then compare both reproduction documents with comrak's NodeList::padding and the item's content offset. Done means the first document reports the continuation-line spaces, the neighbouring document remains clean, and the outer-marker case reports both listed locations without adding false positives.

由索引模型根据 Issue 内容生成。

评估

技术栈
markdown, rust
领域
tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。