Skip to content

Commit

Permalink
Add support for Unicode links
Browse files Browse the repository at this point in the history
* In function 'external?', URI is now escaped before split.
* Resolves keithmifsud#33.
  • Loading branch information
mukrop committed May 13, 2020
1 parent f6fb51a commit 19bcd19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/jekyll-target-blank.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def not_mailto_link?(link)
# link - a url.
def external?(link)
if link&.match?(URI.regexp(%w(http https)))
URI.parse(link).host != URI.parse(@site_url).host
CGI.parse(URI.escape(link)).host != CGI.parse(CGI.escape(@site_url)).host
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-target-blank/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module JekyllTargetBlank
VERSION = "2.0.0"
VERSION = "2.0.1"
end

0 comments on commit 19bcd19

Please sign in to comment.