File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -98,11 +98,10 @@ def handle_RDOCLINK(url) # :nodoc:
9898
9999 gen_url CGI . escapeHTML ( url ) , CGI . escapeHTML ( text )
100100 when /^rdoc-image:/
101- # Split the string after "rdoc-image:" into url and alt
102- url_alt = $'
103- split_pos = url_alt . index ( %r{:[^/]} )
104- url = split_pos ? url_alt [ 0 , split_pos ] : url_alt
105- alt = split_pos ? url_alt [ split_pos + 1 , url_alt . size ] : nil
101+ # Split the string after "rdoc-image:" into url and alt.
102+ # "path/to/image.jpg:alt text" => ["path/to/image.jpg", "alt text"]
103+ # "http://example.com/path/to/image.jpg:alt text" => ["http://example.com/path/to/image.jpg", "alt text"]
104+ url , alt = $'. split ( /:(?!\/ )/ , 2 )
106105 if alt && !alt . empty?
107106 %[<img src="#{ CGI . escapeHTML ( url ) } " alt="#{ CGI . escapeHTML ( alt ) } ">]
108107 else
You can’t perform that action at this time.
0 commit comments