summaryrefslogtreecommitdiffstats
path: root/doc/asciidoctor-macros/wssalink-inline-macro/extension.rb
diff options
context:
space:
mode:
Diffstat (limited to 'doc/asciidoctor-macros/wssalink-inline-macro/extension.rb')
-rw-r--r--doc/asciidoctor-macros/wssalink-inline-macro/extension.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/asciidoctor-macros/wssalink-inline-macro/extension.rb b/doc/asciidoctor-macros/wssalink-inline-macro/extension.rb
new file mode 100644
index 00000000..3af9c8f3
--- /dev/null
+++ b/doc/asciidoctor-macros/wssalink-inline-macro/extension.rb
@@ -0,0 +1,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