Skip to content

Commit 87a11fd

Browse files
committed
Don't show links between Docs sites in the TOC
(e.g. if you link to /installfest/editors from the Rails course)
1 parent 320df1b commit 87a11fd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/contents.rb

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def subpages_for filename
3636
# but NOT images of the form ![alt text](image_link.jpg)
3737
content.scan /[^!]\[.*?\]\((.*?)\)/ do |link, _|
3838
next if (link =~ /^http/)
39+
next if (link =~ %r(^.+/)) # cross-links to other sites, e.g. /installfest/editors
3940
next if (link =~ %r(^//)) # protocol-less absolute links e.g. //google.com
4041
links.push(link)
4142
end

0 commit comments

Comments
 (0)