MD034 misses a bare URL whose host has no period, such as http://localhost:3000/
- 主要言語
- Rust
- スター
- 407
- フォーク
- 12
- 平均マージ
- 5時間 45分
- マージ済み PR(30日)
- 30
説明
`Open http://localhost:3000/admin in your browser.` is a link on GitHub and MD034 says nothing about it. `mado` 0.3.2 reported it; #418 does not.
A period is asked of a `www.` host and not of a scheme'd one. github/cmark-gfm `extensions/autolink.c` passes `allow_short` for the second and not the first:
```c
link_end = check_domain(data, size, 0); /* www_match */
domain_len = check_domain(data + link_end, size - link_end, 1); /* url_match */
```
and says so where `allow_short` is read:
```c
if (allow_short) {
/* We don't need a valid domain in the strict sense (with
* least one dot; so just make sure it's composed of valid
* domain characters and return the length of the the valid
* sequence. */
return i;
} else {
/* a valid domain needs to have at least a dot.
* that's as far as we get */
return np ? i : 0;
}
```
comrak 0.54 passes `relaxed_autolinks` to both, which is `false` by default, so it asks a period of `http://` too (`src/parser/autolink.rs`):
```rust
let mut link_end = check_domain(&subject.input[i + 3..], relaxed_autolinks)? + 3;
```
This is the one to weigh, because `http://localhost:PORT/…` is what a development setup is written with. markdownlint reports it, `main` reports it, GitHub links it, and #418 reports nothing.
#408 has this the other way round — its table gives `http://localhost/x` as "not autolinked — no `.` in the domain" and counts it a defect that mado reported it. That row is the `www.` rule applied to a scheme, and closing it was a report lost rather than a false positive dropped.
MD034 reports the links its parser makes, which is what #418 settled, so there is nothing to fix in the rule: `rule::md034::tests::check_no_errors_with_domain_without_period` pins the loss and names this issue. What is left is comrak.
Related: #420, the same shape for an upper-case scheme.
コントリビューションガイド
評価
この issue はまだ評価されていません。