diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
commit | 9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch) | |
tree | 2784370cda9bbf2da9114d70f05399c0b229d28c /doc/asciidoctor-macros/cveidlink-inline-macro/extension.rb | |
parent | Adding debian version 4.2.6-1. (diff) | |
download | wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.tar.xz wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/asciidoctor-macros/cveidlink-inline-macro/extension.rb')
-rw-r--r-- | doc/asciidoctor-macros/cveidlink-inline-macro/extension.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/asciidoctor-macros/cveidlink-inline-macro/extension.rb b/doc/asciidoctor-macros/cveidlink-inline-macro/extension.rb new file mode 100644 index 00000000..2dec88da --- /dev/null +++ b/doc/asciidoctor-macros/cveidlink-inline-macro/extension.rb @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: MIT +require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal' + +include ::Asciidoctor + +# An inline macro that generates a link to a CVE Record identified by its CVE +# Number. +# +# Usage +# +# cveidlink:<cve-number>[] +# +class CVEIdLinkInlineMacro < Extensions::InlineMacroProcessor + include WsUtils + use_dsl + + named :cveidlink + + def process(parent, cvenum, _attrs) + cvename = "CVE-#{cvenum}" + target = %(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-#{cvenum}) + create_doc_links(parent, target, cvename) + end +end |