Skip to content

Commit

Permalink
Ah, regexp.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjtorikian committed Nov 17, 2019
1 parent 93ddeb2 commit 3d74c0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/html-proofer/element.rb
Expand Up @@ -150,7 +150,7 @@ def internal_absolute_link?
def relative_link?
return false if remote?

hash_link || param_link || url.start_with?('.') || url =~ /^\w/
hash_link || param_link || url.start_with?('.') || url =~ /^\S/
end

def link_points_to_same_page?
Expand Down Expand Up @@ -237,9 +237,11 @@ def html
# If link is on the same page, then URL is on the current page. use the same HTML as for current page
if link_points_to_same_page?
@html
elsif internal_absolute_link?
elsif internal?
# link on another page, e.g. /about#Team - need to get HTML from the other page
create_nokogiri(absolute_path)
else
raise NotImplementedError, 'HTMLProofer should not have gotten here. Please report this as a bug.'
end
end
end
Expand Down

0 comments on commit 3d74c0b

Please sign in to comment.