File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -105,10 +105,11 @@ defmodule ExDoc.Autolink do
105
105
uri <- URI . parse ( href ) ,
106
106
nil <- uri . host ,
107
107
true <- is_binary ( uri . path ) ,
108
- true <- uri . path == Path . basename ( uri . path ) ,
109
108
".md" <- Path . extname ( uri . path ) do
110
- if uri . path in config . extras do
111
- without_ext = String . trim_trailing ( uri . path , ".md" )
109
+ md_file = Path . basename ( uri . path )
110
+
111
+ if md_file in config . extras do
112
+ without_ext = String . trim_trailing ( md_file , ".md" )
112
113
fragment = ( uri . fragment && "#" <> uri . fragment ) || ""
113
114
HTML . text_to_id ( without_ext ) <> config . ext <> fragment
114
115
else
Original file line number Diff line number Diff line change @@ -202,6 +202,8 @@ defmodule ExDoc.AutolinkTest do
202
202
203
203
assert autolink ( ~m" [Foo](Foo Bar.md#baz)" , opts ) == ~m" [Foo](foo-bar.html#baz)"
204
204
205
+ assert autolink ( ~m" [Foo](../guide/Foo Bar.md)" , opts ) == ~m" [Foo](foo-bar.html)"
206
+
205
207
assert_unchanged ( ~m" [Foo](http://example.com/foo.md)" , opts )
206
208
207
209
assert_unchanged ( ~m" [Foo](#baz)" , opts )
You can’t perform that action at this time.
0 commit comments