summaryrefslogtreecommitdiffstats
path: root/doc/asciidoctor-macros/wssalink-inline-macro/extension.rb
blob: 3af9c8f32ba7e8c92510f44f82db96d9e9697409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# SPDX-License-Identifier: MIT
require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'

include ::Asciidoctor

# An inline macro that generates a link to a Wireshark Security Advisory.
#
# Usage
#
#   wssalink:<dddd>[]
#
class WSSALinkInlineMacro < Extensions::InlineMacroProcessor
  include WsUtils
  use_dsl

  named :'wssalink'

  def process(parent, sanum, attrs)
    satext = "wnpa-sec-#{sanum}"
    target = %(https://www.wireshark.org/security/wnpa-sec-#{sanum})
    create_doc_links(parent, target, satext)
  end
end