Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222 changes: 130 additions & 92 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ path = "builder.rs"

[dependencies]
lychee-lib = { path = "../../lychee-lib", default-features = false }
tokio = { version = "1.42.0", features = ["full"] }
tokio = { version = "1.43.0", features = ["full"] }
regex = "1.11.1"
http = "1.2.0"
reqwest = { version = "0.12.9", default-features = false, features = ["gzip"] }
Expand Down
4 changes: 2 additions & 2 deletions examples/chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ name = "chain"
path = "chain.rs"

[dependencies]
async-trait = "0.1.84"
async-trait = "0.1.86"
lychee-lib = { path = "../../lychee-lib", default-features = false }
reqwest = "0.12.9"
tokio = { version = "1.42.0", features = ["full"] }
tokio = { version = "1.43.0", features = ["full"] }

[features]
email-check = ["lychee-lib/email-check"]
Expand Down
2 changes: 1 addition & 1 deletion examples/client_pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ path = "client_pool.rs"
futures = "0.3.31"
tokio-stream = "0.1.17"
lychee-lib = { path = "../../lychee-lib", default-features = false }
tokio = { version = "1.42.0", features = ["full"] }
tokio = { version = "1.43.0", features = ["full"] }

[features]
email-check = ["lychee-lib/email-check"]
Expand Down
2 changes: 1 addition & 1 deletion examples/collect_links/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ path = "collect_links.rs"

[dependencies]
lychee-lib = { path = "../../lychee-lib", default-features = false }
tokio = { version = "1.42.0", features = ["full"] }
tokio = { version = "1.43.0", features = ["full"] }
regex = "1.11.1"
http = "1.2.0"
tokio-stream = "0.1.17"
Expand Down
2 changes: 1 addition & 1 deletion examples/extract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ path = "extract.rs"

[dependencies]
lychee-lib = { path = "../../lychee-lib", default-features = false }
tokio = { version = "1.42.0", features = ["full"] }
tokio = { version = "1.43.0", features = ["full"] }

[features]
email-check = ["lychee-lib/email-check"]
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ path = "simple.rs"

[dependencies]
lychee-lib = { path = "../../lychee-lib", default-features = false }
tokio = { version = "1.42.0", features = ["full"] }
tokio = { version = "1.43.0", features = ["full"] }

[features]
email-check = ["lychee-lib/email-check"]
Expand Down
30 changes: 15 additions & 15 deletions lychee-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ version.workspace = true
# requires all dependencies to have a version number.
lychee-lib = { path = "../lychee-lib", version = "0.18.1", default-features = false }

anyhow = "1.0.95"
anyhow = "1.0.96"
assert-json-diff = "2.0.2"
clap = { version = "4.5.23", features = ["env", "derive"] }
clap = { version = "4.5.30", features = ["env", "derive"] }
console = "0.15.10"
const_format = "0.2.34"
csv = "1.3.1"
Expand All @@ -29,10 +29,10 @@ headers = "0.4.0"
http = "1.2.0"
humantime = "2.1.0"
humantime-serde = "1.1.1"
indicatif = "0.17.9"
log = "0.4.22"
once_cell = "1.20.2"
openssl-sys = { version = "0.9.104", optional = true }
indicatif = "0.17.11"
log = "0.4.26"
once_cell = "1.20.3"
openssl-sys = { version = "0.9.106", optional = true }
pad = "0.1.6"
regex = "1.11.1"
reqwest = { version = "0.12.9", default-features = false, features = [
Expand All @@ -44,16 +44,16 @@ reqwest_cookie_store = "0.8.0"
# See https://github.com/briansmith/ring/issues/1163
# This is necessary for the homebrew build
# https://github.com/Homebrew/homebrew-core/pull/70216
ring = "0.17.8"
ring = "0.17.11"
secrecy = { version = "0.10.3", features = ["serde"] }
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.134"
strum = { version = "0.26.3", features = ["derive"] }
serde = { version = "1.0.218", features = ["derive"] }
serde_json = "1.0.139"
strum = { version = "0.27.1", features = ["derive"] }
supports-color = "3.0.2"
tabled = "0.17.0"
tokio = { version = "1.42.0", features = ["full"] }
tabled = "0.18.0"
tokio = { version = "1.43.0", features = ["full"] }
tokio-stream = "0.1.17"
toml = "0.8.19"
toml = "0.8.20"
url = "2.5.4"
human-sort = "0.2.2"

Expand All @@ -62,13 +62,13 @@ assert_cmd = "2.0.16"
cookie_store = "0.21.1"
predicates = "3.1.3"
pretty_assertions = "1.4.1"
tempfile = "3.15.0"
tempfile = "3.17.1"
tracing-subscriber = { version = "0.3.19", default-features = false, features = [
"fmt",
"registry",
"env-filter",
] }
uuid = { version = "1.11.0", features = ["v4"] }
uuid = { version = "1.14.0", features = ["v4"] }
wiremock = "0.6.2"

[features]
Expand Down
32 changes: 16 additions & 16 deletions lychee-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ version.workspace = true

[dependencies]
async-stream = "0.3.6"
async-trait = "0.1.84"
async-trait = "0.1.86"
cached = "0.54.0"
check-if-email-exists = { version = "0.9.1", optional = true }
cookie_store = "0.21.1"
email_address = "0.2.9"
futures = "0.3.31"
glob = "0.3.2"
headers = "0.4.0"
html5ever = "0.29.0"
html5ever = "0.29.1"
html5gum = "0.7.0"
http = "1.2.0"
hyper = "1.5.2"
hyper = "1.6.0"
ignore = "0.4.23"
ip_network = "0.4.1"
linkify = "0.10.0"
log = "0.4.22"
octocrab = "0.42.1"
once_cell = "1.20.2"
openssl-sys = { version = "0.9.104", optional = true }
log = "0.4.26"
octocrab = "0.43.0"
once_cell = "1.20.3"
openssl-sys = { version = "0.9.106", optional = true }
path-clean = "1.0.1"
percent-encoding = "2.3.1"
pulldown-cmark = "0.12.2"
pulldown-cmark = "0.13.0"
regex = "1.11.1"
# Use trust-dns to avoid lookup failures on high concurrency
# https://github.com/seanmonstar/reqwest/issues/296
Expand All @@ -48,14 +48,14 @@ reqwest_cookie_store = { version = "0.8.0", features = ["serde"] }
# See https://github.com/briansmith/ring/issues/1163
# This is necessary for the homebrew build
# https://github.com/Homebrew/homebrew-core/pull/70216
ring = "0.17.8"
ring = "0.17.11"
secrecy = "0.10.3"
serde = { version = "1.0.217", features = ["derive"] }
serde = { version = "1.0.218", features = ["derive"] }
serde_with = "3.12.0"
shellexpand = "3.1.0"
thiserror = "2.0.9"
tokio = { version = "1.42.0", features = ["full"] }
toml = "0.8.19"
thiserror = "2.0.11"
tokio = { version = "1.43.0", features = ["full"] }
toml = "0.8.20"
typed-builder = "0.20.0"
url = { version = "2.5.4", features = ["serde"] }

Expand All @@ -65,11 +65,11 @@ features = ["runtime-tokio"]

[dev-dependencies]
doc-comment = "0.3.3"
tempfile = "3.15.0"
tempfile = "3.17.1"
wiremock = "0.6.2"
serde_json = "1.0.134"
serde_json = "1.0.139"
rstest = "0.24.0"
toml = "0.8.19"
toml = "0.8.20"
pretty_assertions = "1.4.0"

[features]
Expand Down
27 changes: 27 additions & 0 deletions lychee-lib/src/extract/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub(crate) fn extract_markdown(input: &str, include_verbatim: bool) -> Vec<RawUr
}) => {
// Note: Explicitly listing all link types below to make it easier to
// change the behavior for a specific link type in the future.
#[allow(clippy::match_same_arms)]
match link_type {
// Inline link like `[foo](bar)`
// This is the most common link type
Expand Down Expand Up @@ -60,6 +61,17 @@ pub(crate) fn extract_markdown(input: &str, include_verbatim: bool) -> Vec<RawUr
// Email address in autolink like `<john@example.org>`
LinkType::Email =>
Some(extract_raw_uri_from_plaintext(&dest_url)),
// Wiki URL (`[[http://example.com]]`)
// This element is currently not matched and I'm not sure why.
// However, we keep it in here for future compatibility with
// markup5ever.
LinkType::WikiLink { has_pothole: _ } => {
Some(vec![RawUri {
text: dest_url.to_string(),
element: Some("a".to_string()),
attribute: Some("href".to_string()),
}])
}
}
}

Expand Down Expand Up @@ -373,4 +385,19 @@ $$
let uris = extract_markdown(markdown, true);
assert_eq!(uris, expected);
}

#[test]
fn test_wiki_link() {
let markdown = r"[[https://example.com/destination]]";
let expected = vec![RawUri {
text: "https://example.com/destination".to_string(),
// This should be a link element, but is currently matched as plaintext
element: None,
attribute: None,
// element: Some("a".to_string()),
// attribute: Some("href".to_string()),
}];
let uris = extract_markdown(markdown, true);
assert_eq!(uris, expected);
}
}
Loading