diff options
author | Dario Lombardo <lomato@gmail.com> | 2018-06-23 14:03:49 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-06-27 17:01:18 +0000 |
commit | e4e0488da93d6eb43731d14f96544ab33928a005 (patch) | |
tree | 4b970a81437b6352cc197ac716f566038a7eeb97 /docbook/asciidoctor-macros/cveidlink-inline-macro | |
parent | 622b17a475a81aa3af5cc743b831d01233b99c31 (diff) |
docbook: reduce ruby code duplication by introducing utils module.
Change-Id: I7e436db3cb86f5ebd0f5827c6da630303bc3f538
Reviewed-on: https://code.wireshark.org/review/28400
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'docbook/asciidoctor-macros/cveidlink-inline-macro')
-rw-r--r-- | docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb b/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb index 8e2b741a25..0c07233018 100644 --- a/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb +++ b/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb @@ -10,21 +10,14 @@ include ::Asciidoctor # cveidlink:<cve-number>[] # class CVEIdLinkInlineMacro < Extensions::InlineMacroProcessor + include WsUtils use_dsl named :cveidlink def process(parent, cvenum, _attrs) cvename = "CVE-#{cvenum}" - suffix = '' target = %(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-#{cvenum}) - if parent.document.basebackend? 'html' - parent.document.register :links, target - %(#{(create_anchor parent, cvename, type: :link, target: target).render}) - elsif parent.document.backend == 'manpage' - %(\\fB#{cvename}) - else - %(#{cvename}) - end + create_doc_links(parent, target, cvename) end end |