akiomik / akiomik/mado

MD034 is the only rule that reports an exclusive end column

Aperta
#424 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
Rust
Stelle
407
Fork
12
Merge medio
5h 45m
PR unite (30g)
30

Descrizione

Every rule reports the position comrak gives it, whose end column is the span's last byte. MD034 steps one past:

| Written | Reported | The span's last byte |
| --- | --- | --- |
| `see http://a.com/ now` (MD034) | `1:5-1:18` | 17, the `/`; 18 is the space |
| `*see now*` (MD036) | `1:1-1:9` | 9 |
| `x * a b * y` (MD037) | `1:3-1:9` | 9 |

A URL that runs to the end of its line is reported ending a column past the line.

Invisible today: `concise`, `mdl` and `markdownlint` all render `start` alone. It is not invisible to a library caller — `Violation::position()` is public — and a `--fix` reading the span would delete or highlight one character too many.

It has been this way since the rule was written: `linkify`'s `end()` is exclusive and the first version added it to the start column. #407 kept it deliberately while correcting what the columns were measured against, and #418 kept it again while changing where they come from, both times to leave the reported positions where they were rather than move them inside a change about something else.

So it is a decision that has been deferred twice and is worth making: either MD034 joins the convention, or the convention is that an end column is exclusive and the other rules are the ones out of step. Whichever way, it wants writing down somewhere better than a comment on the `+= 1`.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.