File: extension.rb

package info (click to toggle)
wireshark 4.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 351,244 kB
  • sloc: ansic: 3,101,885; cpp: 129,710; xml: 100,972; python: 56,512; perl: 24,575; sh: 5,874; lex: 4,383; pascal: 4,304; makefile: 165; ruby: 113; objc: 91; tcl: 35
file content (25 lines) | stat: -rw-r--r-- 663 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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:<number>[<issue text>]
#   Default bug text is "Issue <number>".
#
class WSBugLinkInlineMacro < Extensions::InlineMacroProcessor
  include WsUtils
  use_dsl

  named :wsbuglink
  parse_content_as :text

  def process(parent, issueid, attrs)
    bugtext = !attrs['text'].nil_or_empty? ? attrs['text'] : %(Issue #{issueid})
    target = %(https://gitlab.com/wireshark/wireshark/-/issues/#{issueid})
    create_doc_links(parent, target, bugtext)
  end
end