File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -576,11 +576,15 @@ def parse_link
576
576
current_link = @tree . children . select { |element | [ :a ] . include? ( element . type ) } . last
577
577
unless current_link . nil?
578
578
579
- # If inline link ends with .md
580
- if match = current_link . attr [ "href" ] . match ( /\A ([^\s ]*)\. md(\s *.*)\z / )
581
-
582
- # Rewrite as /, just as jekyll-relative-links does
583
- current_link . attr [ "href" ] = match . captures [ 0 ] + "/" + match . captures [ 1 ]
579
+ # If a relative link
580
+ if !current_link . attr [ "href" ] . start_with? ( "https://" , "http://" )
581
+
582
+ # If link ends with .md
583
+ if match = current_link . attr [ "href" ] . match ( /\A ([^\s ]*)\. md(\s *.*)\z / )
584
+
585
+ # Rewrite as /, just as jekyll-relative-links does
586
+ current_link . attr [ "href" ] = match . captures [ 0 ] + "/" + match . captures [ 1 ]
587
+ end
584
588
end
585
589
end
586
590
end
You can’t perform that action at this time.
0 commit comments