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.
* This adheres to the recommendation in the URI docs: https://www.rubydoc.info/stdlib/uri/URI.parse
* Resolves keithmifsud#33.
  • Loading branch information
mukrop committed Oct 27, 2019
1 parent f6fb51a commit e4b9c32
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
URI.parse(URI.escape(link)).host != URI.parse(URI.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 e4b9c32

Please sign in to comment.