From fb5dac150b8810131105059858fe4a9dfbaae6aa Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 15 May 2023 14:01:58 +0800 Subject: [PATCH] Update Wikipedia link inline macro --- lib/asciidoctor/wikipedia-inline-macro/extension.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/asciidoctor/wikipedia-inline-macro/extension.rb b/lib/asciidoctor/wikipedia-inline-macro/extension.rb index c2a0d60..5c7a6c7 100644 --- a/lib/asciidoctor/wikipedia-inline-macro/extension.rb +++ b/lib/asciidoctor/wikipedia-inline-macro/extension.rb @@ -11,7 +11,8 @@ class WikipediaInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor def process(parent, target, attrs) caption = attrs['caption'] || target - page = URI.encode_www_form_component target + parser = URI::Parser.new + page = parser.escape target link = %(https://#{attrs['lang']}.wikipedia.org/wiki/#{page}) node = create_anchor parent, caption, type: :link, target: link