-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
warn about links with empty href destination
I often make blank links as a note to myself to remember to fill in a URL. If I forget, though, there will be a link that just brings the user to the top of the page, which isn't what I want. So now, we warn on these empty links. If you want to bring the user to the top of the page, use an explicit `#` character. Fixes #492
- Loading branch information
Showing
5 changed files
with
28 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ my @page_tests = ( | |
"Full URLs without schema are not broken" => '//example.com', | ||
"Fixed relative URL" => '/blog/2014/06/02/more_tags/docs.html', | ||
"Test a mailto: link" => 'mailto:[email protected]', | ||
'No link destination' => '/blog/2014/06/02/more_tags/', | ||
); | ||
my @links = $dom->find( 'article .content a' )->each; | ||
is scalar @links, scalar keys %links, 'all links found'; | ||
|
@@ -813,6 +814,7 @@ my @page_tests = ( | |
"Full URLs without schema are not broken" => '//example.com', | ||
"Fixed relative URL" => 'docs.html', | ||
"Test a mailto: link" => 'mailto:[email protected]', | ||
'No link destination' => '', | ||
); | ||
my @links = $dom->find( 'section a' )->each; | ||
is scalar @links, scalar keys %links, 'all links found'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,6 @@ links: | |
[Fixed relative URL](docs.html) | ||
|
||
[Test a mailto: link](mailto:[email protected]) | ||
|
||
[No link destination]() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters