Skip to content

Commit

Permalink
Update wiki.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
lmrodriguezr committed Dec 3, 2024
1 parent c3a91ab commit fdb1e96
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/models/name/wiki.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ def check_wikispecies
issues << "SeqCode entry not linked"
end
if parent && parent != self
if xml.xpath("//a[@href='/wiki/#{parent.wiki_url_name}']").empty?
i = parent.wiki_url_name
unless xml.xpath("//a[@href='/wiki/#{i}']").any? ||
xml.xpath("//a[starts-with(@href,'/w/index.php?title=#{i}&')]").any?
issues << "parent not linked: #{parent.name}"
end
end
valid_children.each do |child|
if xml.xpath("//a[@href='/wiki/#{child.wiki_url_name}']").empty?
i = child.wiki_url_name
unless xml.xpath("//a[@href='/wiki/#{i}']").any? ||
xml.xpath("//a[starts-with(@href,'/w/index.php?title=#{i}&')]").any?
issues << "child not linked: #{child.name}"
end
end
Expand Down

0 comments on commit fdb1e96

Please sign in to comment.