mirror of
https://github.com/Hopiu/lychee.git
synced 2026-03-17 05:00:26 +00:00
example.com -> example.org
This commit is contained in:
parent
8d165a3cda
commit
e00cdbf1ae
12 changed files with 56 additions and 56 deletions
6
.github/workflows/links.yml
vendored
6
.github/workflows/links.yml
vendored
|
|
@ -11,12 +11,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
|
||||
- name: Link Checker
|
||||
uses: lycheeverse/lychee-action@master
|
||||
with:
|
||||
args: --exclude https://example.com/README.md
|
||||
|
||||
args: --exclude 'https://example.org/README.md'
|
||||
|
||||
- name: Create Issue From File
|
||||
uses: peter-evans/create-issue-from-file@v2
|
||||
with:
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ OPTIONS:
|
|||
|
||||
ARGS:
|
||||
<inputs>... The inputs (where to get links to check from). These can be: files (e.g. `README.md`), file globs
|
||||
(e.g. `"~/git/*/README.md"`), remote URLs (e.g. `https://example.com/README.md`) or standard
|
||||
(e.g. `"~/git/*/README.md"`), remote URLs (e.g. `https://example.org/README.md`) or standard
|
||||
input (`-`). Prefix with `--` to separate inputs from options that allow multiple arguments
|
||||
[default: README.md]
|
||||
```
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ Some more complex formatting to test that Markdown parsing works.
|
|||
[](https://creativecommons.org/publicdomain/zero/1.0/)
|
||||
|
||||
Test HTTP and HTTPS for the same site.
|
||||
http://example.com
|
||||
https://example.com
|
||||
http://example.org
|
||||
https://example.org
|
||||
|
||||
https://www.peerlyst.com/posts/a-list-of-static-analysis-tools-for-c-c-peerlyst
|
||||
|
||||
test@example.com
|
||||
mailto:test2@example.com
|
||||
test@example.org
|
||||
mailto:test2@example.org
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="home" href="https://example.com/head/home">
|
||||
<link rel="home" href="https://example.org/head/home">
|
||||
<title>Test</title>
|
||||
<meta name="description" content="Test HTML5 parsing (not valid XML)">
|
||||
|
||||
<!-- The links below have no closing tags (not valid XML) -->
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="images/icon.png">
|
||||
<link rel="stylesheet" type="text/css" href="https://example.com/css/style_full_url.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://example.org/css/style_full_url.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/style_relative_url.css">
|
||||
|
||||
<!-- The defer attribute has no value (not valid XML) -->
|
||||
|
|
@ -16,8 +16,8 @@
|
|||
</head>
|
||||
<body>
|
||||
Hello world.
|
||||
<a href="https://example.com/body/a">Link in body</a>
|
||||
<a href="https://example.org/body/a">Link in body</a>
|
||||
<!-- Empty a tag might be problematic (in terms of browser support), but should still be parsed -->
|
||||
<div><a href="https://example.com/body/div_empty_a"/></div>
|
||||
<div><a href="https://example.org/body/div_empty_a"/></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<some-weird-element href="https://example.com/some-weird-element"></some-weird-element>
|
||||
<even-weirder fake-attr src="https://example.com/even-weirder-src" href="https://example.com/even-weirder-href"></even-weirder>
|
||||
<citations cite="https://example.com/citations"></citations>
|
||||
<some-weird-element href="https://example.org/some-weird-element"></some-weird-element>
|
||||
<even-weirder fake-attr src="https://example.org/even-weirder-src" href="https://example.org/even-weirder-href"></even-weirder>
|
||||
<citations cite="https://example.org/citations"></citations>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<a href="https://example.com/body/a">Link in body</a>
|
||||
<a href="https://example.org/body/a">Link in body</a>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<a href="https;//example.com/malformed_one">Malformed link</a>
|
||||
<a href="https://example]com/malformed_two">Malformed link</a>
|
||||
<a href="https://example.com/valid">Valid link</a>
|
||||
<a href="https;//example.org/malformed_one">Malformed link</a>
|
||||
<a href="https://example]org/malformed_two">Malformed link</a>
|
||||
<a href="https://example.org/valid">Valid link</a>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<!DOCTYPE html><html class=no-js lang=en><head><link href=https://example.com/ rel=canonical><link href=https://example.com/favicon.ico rel="shortcut icon"><link crossorigin="" href=https://fonts.externalsite.com rel=preconnect><body><div></div><header><nav><a href=https://example.com/docs/ title=Docs></a><div><a href=https://example.com/ title=Home></a></div></nav></header><div><nav><div><ul><li><a href=https://example.com/forum>Forum</a></ul></div></nav></div>
|
||||
<!DOCTYPE html><html class=no-js lang=en><head><link href=https://example.org/ rel=canonical><link href=https://example.org/favicon.ico rel="shortcut icon"><link crossorigin="" href=https://fonts.externalsite.com rel=preconnect><body><div></div><header><nav><a href=https://example.org/docs/ title=Docs></a><div><a href=https://example.org/ title=Home></a></div></nav></header><div><nav><div><ul><li><a href=https://example.org/forum>Forum</a></ul></div></nav></div>
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ macro_rules! fold_in {
|
|||
pub(crate) struct LycheeOptions {
|
||||
/// The inputs (where to get links to check from).
|
||||
/// These can be: files (e.g. `README.md`), file globs (e.g. `"~/git/*/README.md"`),
|
||||
/// remote URLs (e.g. `https://example.com/README.md`) or standard input (`-`).
|
||||
/// remote URLs (e.g. `https://example.org/README.md`) or standard input (`-`).
|
||||
/// Prefix with `--` to separate inputs from options that allow multiple arguments.
|
||||
#[structopt(name = "inputs", default_value = "README.md")]
|
||||
raw_inputs: Vec<String>,
|
||||
|
|
|
|||
|
|
@ -116,17 +116,17 @@ mod test_super {
|
|||
fn test_stats() {
|
||||
let mut stats = ResponseStats::new();
|
||||
stats.add(Response {
|
||||
uri: website("http://example.com/ok"),
|
||||
uri: website("http://example.org/ok"),
|
||||
status: Status::Ok(http::StatusCode::OK),
|
||||
source: Input::Stdin,
|
||||
});
|
||||
stats.add(Response {
|
||||
uri: website("http://example.com/failed"),
|
||||
uri: website("http://example.org/failed"),
|
||||
status: Status::Failed(http::StatusCode::BAD_GATEWAY),
|
||||
source: Input::Stdin,
|
||||
});
|
||||
stats.add(Response {
|
||||
uri: website("http://example.com/redirect"),
|
||||
uri: website("http://example.org/redirect"),
|
||||
status: Status::Redirected(http::StatusCode::PERMANENT_REDIRECT),
|
||||
source: Input::Stdin,
|
||||
});
|
||||
|
|
@ -135,12 +135,12 @@ mod test_super {
|
|||
Input::Stdin,
|
||||
vec![
|
||||
Response {
|
||||
uri: website("http://example.com/failed"),
|
||||
uri: website("http://example.org/failed"),
|
||||
status: Status::Failed(http::StatusCode::BAD_GATEWAY),
|
||||
source: Input::Stdin,
|
||||
},
|
||||
Response {
|
||||
uri: website("http://example.com/redirect"),
|
||||
uri: website("http://example.org/redirect"),
|
||||
status: Status::Redirected(http::StatusCode::PERMANENT_REDIRECT),
|
||||
source: Input::Stdin,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ mod test {
|
|||
#[test]
|
||||
fn test_non_markdown_links() {
|
||||
let input =
|
||||
"https://endler.dev and https://hello-rust.show/foo/bar?lol=1 at test@example.com";
|
||||
"https://endler.dev and https://hello-rust.show/foo/bar?lol=1 at test@example.org";
|
||||
let links: HashSet<Uri> =
|
||||
extract_links(&InputContent::from_string(input, FileType::Plaintext), None)
|
||||
.into_iter()
|
||||
|
|
@ -299,7 +299,7 @@ mod test {
|
|||
let expected = [
|
||||
website("https://endler.dev"),
|
||||
website("https://hello-rust.show/foo/bar?lol=1"),
|
||||
Uri::Mail("test@example.com".to_string()),
|
||||
Uri::Mail("test@example.org".to_string()),
|
||||
]
|
||||
.iter()
|
||||
.cloned()
|
||||
|
|
@ -330,11 +330,11 @@ mod test {
|
|||
.collect();
|
||||
|
||||
let expected_links = [
|
||||
website("https://example.com/head/home"),
|
||||
website("https://example.com/css/style_full_url.css"),
|
||||
website("https://example.org/head/home"),
|
||||
website("https://example.org/css/style_full_url.css"),
|
||||
// the body links wouldn't be present if the file was parsed strictly as XML
|
||||
website("https://example.com/body/a"),
|
||||
website("https://example.com/body/div_empty_a"),
|
||||
website("https://example.org/body/a"),
|
||||
website("https://example.org/body/div_empty_a"),
|
||||
]
|
||||
.iter()
|
||||
.cloned()
|
||||
|
|
@ -348,21 +348,21 @@ mod test {
|
|||
let input = load_fixture("TEST_HTML5.html");
|
||||
let links: HashSet<Uri> = extract_links(
|
||||
&InputContent::from_string(&input, FileType::Html),
|
||||
Some(Url::parse("https://example.com").unwrap()),
|
||||
Some(Url::parse("https://example.org").unwrap()),
|
||||
)
|
||||
.into_iter()
|
||||
.map(|r| r.uri)
|
||||
.collect();
|
||||
|
||||
let expected_links = [
|
||||
website("https://example.com/head/home"),
|
||||
website("https://example.com/images/icon.png"),
|
||||
website("https://example.com/css/style_relative_url.css"),
|
||||
website("https://example.com/css/style_full_url.css"),
|
||||
website("https://example.com/js/script.js"),
|
||||
website("https://example.org/head/home"),
|
||||
website("https://example.org/images/icon.png"),
|
||||
website("https://example.org/css/style_relative_url.css"),
|
||||
website("https://example.org/css/style_full_url.css"),
|
||||
website("https://example.org/js/script.js"),
|
||||
// the body links wouldn't be present if the file was parsed strictly as XML
|
||||
website("https://example.com/body/a"),
|
||||
website("https://example.com/body/div_empty_a"),
|
||||
website("https://example.org/body/a"),
|
||||
website("https://example.org/body/div_empty_a"),
|
||||
]
|
||||
.iter()
|
||||
.cloned()
|
||||
|
|
@ -381,7 +381,7 @@ mod test {
|
|||
.map(|r| r.uri)
|
||||
.collect();
|
||||
|
||||
let expected_links = [website("https://example.com/body/a")]
|
||||
let expected_links = [website("https://example.org/body/a")]
|
||||
.iter()
|
||||
.cloned()
|
||||
.collect();
|
||||
|
|
@ -400,11 +400,11 @@ mod test {
|
|||
.collect();
|
||||
|
||||
let expected_links = [
|
||||
website("https://example.com/"),
|
||||
website("https://example.com/favicon.ico"),
|
||||
website("https://example.org/"),
|
||||
website("https://example.org/favicon.ico"),
|
||||
website("https://fonts.externalsite.com"),
|
||||
website("https://example.com/docs/"),
|
||||
website("https://example.com/forum"),
|
||||
website("https://example.org/docs/"),
|
||||
website("https://example.org/forum"),
|
||||
]
|
||||
.iter()
|
||||
.cloned()
|
||||
|
|
@ -424,7 +424,7 @@ mod test {
|
|||
.collect();
|
||||
|
||||
let expected_links = [Uri::Website(
|
||||
Url::parse("https://example.com/valid").unwrap(),
|
||||
Url::parse("https://example.org/valid").unwrap(),
|
||||
)]
|
||||
.iter()
|
||||
.cloned()
|
||||
|
|
@ -444,10 +444,10 @@ mod test {
|
|||
.collect();
|
||||
|
||||
let expected_links = [
|
||||
website("https://example.com/some-weird-element"),
|
||||
website("https://example.com/even-weirder-src"),
|
||||
website("https://example.com/even-weirder-href"),
|
||||
website("https://example.com/citations"),
|
||||
website("https://example.org/some-weird-element"),
|
||||
website("https://example.org/even-weirder-src"),
|
||||
website("https://example.org/even-weirder-href"),
|
||||
website("https://example.org/citations"),
|
||||
]
|
||||
.iter()
|
||||
.cloned()
|
||||
|
|
|
|||
12
src/uri.rs
12
src/uri.rs
|
|
@ -74,16 +74,16 @@ mod test {
|
|||
fn test_uri_from_str() {
|
||||
assert!(matches!(Uri::try_from(""), Err(_)));
|
||||
assert_eq!(
|
||||
Uri::try_from("http://example.com").unwrap(),
|
||||
website("http://example.com")
|
||||
Uri::try_from("http://example.org").unwrap(),
|
||||
website("http://example.org")
|
||||
);
|
||||
assert_eq!(
|
||||
Uri::try_from("mail@example.com").unwrap(),
|
||||
Uri::Mail("mail@example.com".to_string())
|
||||
Uri::try_from("mail@example.org").unwrap(),
|
||||
Uri::Mail("mail@example.org".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
Uri::try_from("mailto:mail@example.com").unwrap(),
|
||||
Uri::Mail("mail@example.com".to_string())
|
||||
Uri::try_from("mailto:mail@example.org").unwrap(),
|
||||
Uri::Mail("mail@example.org".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue