Skip to content

Commit

Permalink
Ignore links without paths in crawl mode
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed Mar 15, 2017
1 parent 9f4203d commit 9c1e79c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function relativePathsFromHtml(options) {

var parsed = url.parse(href);

if (parsed.protocol) {
if (parsed.protocol || typeof parsed.path !== 'string') {
return null;
}

Expand Down
1 change: 1 addition & 0 deletions test/success-cases/crawl-ignore/expected-output/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
<li><a href="http://webpack.js.org">Absolute Link</a></li>
<li><a href="//webpack.js.org">Protocol Relative Link</a></li>
<li><a href="mailto:hello@example.com">Email Link</a></li>
<li><a href="#hashtown">Hash Link</a></li>
</ul>
1 change: 1 addition & 0 deletions test/success-cases/crawl-ignore/template.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
<li><a href="http://webpack.js.org">Absolute Link</a></li>
<li><a href="//webpack.js.org">Protocol Relative Link</a></li>
<li><a href="mailto:hello@example.com">Email Link</a></li>
<li><a href="#hashtown">Hash Link</a></li>
</ul>

0 comments on commit 9c1e79c

Please sign in to comment.