History

Normalize xlink:href attributes like HTML href ones…

…so links inside SVGs, such as those in Rust's railroad diagrams, can work properly.

Calum Smith committed 1 year ago

Commit ee0e3471 parent d777a8a1 file · +5 −2Browse files

Unified · Split

lib/docs/filters/core/normalize_paths.rb+5−2
@@ -7,8 +7,11 @@ module Docs · 6 unmodified lines
7 result[:store_path] = store_path7 result[:store_path] = store_path
8 8
9 css('a').each do |link|9 css('a').each do |link|
10 next unless (href = link['href']) && relative_url_string?(href)10 href = link['href']
11 link['href'] = normalize_href(href)11 link['href'] = normalize_href(href) if href && relative_url_string?(href)
12
13 xlink_href = link['xlink:href']
14 link['xlink:href'] = normalize_href(xlink_href) if xlink_href && relative_url_string?(xlink_href)
12 end15 end
13 16
14 doc17 doc