From 19bcd194c2521ab0a17a8f2742b34febaab69d0c Mon Sep 17 00:00:00 2001 From: Martin Ukrop Date: Sun, 27 Oct 2019 12:40:59 +0100 Subject: [PATCH] Add support for Unicode links * In function 'external?', URI is now escaped before split. * Resolves #33. --- lib/jekyll-target-blank.rb | 2 +- lib/jekyll-target-blank/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll-target-blank.rb b/lib/jekyll-target-blank.rb index 88ce8d4..bb1ebae 100644 --- a/lib/jekyll-target-blank.rb +++ b/lib/jekyll-target-blank.rb @@ -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 diff --git a/lib/jekyll-target-blank/version.rb b/lib/jekyll-target-blank/version.rb index f137b4a..af87a39 100644 --- a/lib/jekyll-target-blank/version.rb +++ b/lib/jekyll-target-blank/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module JekyllTargetBlank - VERSION = "2.0.0" + VERSION = "2.0.1" end