Class: Asciidoctor::Foodogsquared::Extensions::WikipediaInlineMacro
- Inherits:
-
Extensions::InlineMacroProcessor
- Object
- Extensions::InlineMacroProcessor
- Asciidoctor::Foodogsquared::Extensions::WikipediaInlineMacro
- Defined in:
- lib/asciidoctor/foodogsquared/extensions/wikipedia-inline-macro.rb
Instance Method Summary collapse
Instance Method Details
#process(parent, target, attrs) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/asciidoctor/foodogsquared/extensions/wikipedia-inline-macro.rb', line 13 def process(parent, target, attrs) = attrs['caption'] || target parser = URI::Parser.new page = parser.escape target link = %(https://#{attrs['lang']}.wikipedia.org/wiki/#{page}) node = create_anchor parent, , type: :link, target: link create_inline parent, :quoted, node.convert end |