From 9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 19 Sep 2024 06:14:33 +0200 Subject: Merging upstream version 4.4.0. Signed-off-by: Daniel Baumann --- .../wsbuglink-inline-macro/extension.rb | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 doc/asciidoctor-macros/wsbuglink-inline-macro/extension.rb (limited to 'doc/asciidoctor-macros/wsbuglink-inline-macro/extension.rb') diff --git a/doc/asciidoctor-macros/wsbuglink-inline-macro/extension.rb b/doc/asciidoctor-macros/wsbuglink-inline-macro/extension.rb new file mode 100644 index 00000000..6cdb665b --- /dev/null +++ b/doc/asciidoctor-macros/wsbuglink-inline-macro/extension.rb @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: MIT +require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal' + +include ::Asciidoctor + +# An inline macro that generates a link to a Wireshark bug report. +# +# Usage +# +# wsbuglink:[] +# Default bug text is "Issue ". +# +class WSBugLinkInlineMacro < Extensions::InlineMacroProcessor + include WsUtils + use_dsl + + named :wsbuglink + parse_content_as :text + name_positional_attributes 'bugtext' + + def process(parent, issueid, attrs) + bugtext = attrs['bugtext'] || %(Issue #{issueid}) + target = %(https://gitlab.com/wireshark/wireshark/-/issues/#{issueid}) + create_doc_links(parent, target, bugtext) + end +end -- cgit v1.2.3