filiph / linkcheck

Fast link checker
https://pub.dartlang.org/packages/linkcheck
MIT License
403 stars 51 forks source link

skipped data url reported as invalid #5

Closed chalin closed 7 years ago

chalin commented 7 years ago

When linkcheck is run over https://webdev.dartlang.org/, the following is reported:

http://localhost:4001/angular/api/static-assets/styles.css
- (391:24) url(...) => data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill=' (invalid URL)

even if this skip pattern is used:

^data

Note that the skip pattern is being used:

Done checking: http://localhost:4001/angular/api/static-assets/styles.css (HTTP 200) => 3 links
- will not be checking: data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill=' - URL 'data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='' skipped because it was matched by the following regular expressions of skip file './scripts/config/linkcheck-skip-list.txt': ^data (line 12)

But the data url is none-the-less being reported as invalid. Here is an actual sample entry:

background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='#DDDDDD' d='M6.7,4L5.7,4.9L8.8,8l-3.1,3.1L6.7,12l4-4L6.7,4z'/></svg>");

Skipped links probably shouldn't have validity checks performed on them. (On the hand, I'd also be curious to know why the data url is being considered invalid.)

filiph commented 7 years ago

Thanks! Fixed by https://github.com/filiph/linkcheck/commit/39ac0ac2fccaff119639bb87053c0dc52f59d38f.

Also, from now on, unsupported schemes (such as data:) are not reported as warning. So you can remove that line from the skip file.

chalin commented 7 years ago

Ok, thanks.