mirror of
https://github.com/foo-dogsquared/asciidoctor-foodogsquared-extensions.git
synced 2025-01-31 04:58:07 +00:00
Update Wikipedia link inline macro
This commit is contained in:
parent
144d9fe56f
commit
fb5dac150b
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user