Skip to content

Commit ee0e347

Browse files
committed
Normalize xlink:href attributes like HTML href ones…
…so links inside SVGs, such as those in Rust's railroad diagrams, can work properly.
1 parent d777a8a commit ee0e347

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/docs/filters/core/normalize_paths.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ def call
77
result[:store_path] = store_path
88

99
css('a').each do |link|
10-
next unless (href = link['href']) && relative_url_string?(href)
11-
link['href'] = normalize_href(href)
10+
href = link['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)
1215
end
1316

1417
doc

0 commit comments

Comments
 (0)