From: Gerald Combs Date: Tue, 13 Feb 2018 18:25:47 +0000 (-0800) Subject: Asciidoctor macro fixups. X-Git-Url: http://git.samba.org/?p=metze%2Fwireshark%2Fwip.git;a=commitdiff_plain;h=048c4373e15a401a8700bc57b403282c7830d27e Asciidoctor macro fixups. Fix a few errors in the Asciidoctor macros. Use the new macro names in the release notes and gen-bugnote. Change-Id: I2ca672949c59ca3da8a6b963cb5bd9abd66c348d Reviewed-on: https://code.wireshark.org/review/25774 Reviewed-by: Gerald Combs --- diff --git a/docbook/asciidoctor-macros/cve_idlink-inline-macro.rb b/docbook/asciidoctor-macros/cve_idlink-inline-macro.rb index e2dd67e586..fc1a5e2c9f 100644 --- a/docbook/asciidoctor-macros/cve_idlink-inline-macro.rb +++ b/docbook/asciidoctor-macros/cve_idlink-inline-macro.rb @@ -3,6 +3,6 @@ RUBY_ENGINE == 'opal' ? (require 'cve_idlink-inline-macro/extension') : (require_relative 'cve_idlink-inline-macro/extension') -Extensions.register :uri_schemes do +Extensions.register do inline_macro CVEIdLinkInlineMacro end diff --git a/docbook/asciidoctor-macros/cve_idlink-inline-macro/extension.rb b/docbook/asciidoctor-macros/cve_idlink-inline-macro/extension.rb index 1e505d48d0..fcf1f4ec33 100644 --- a/docbook/asciidoctor-macros/cve_idlink-inline-macro/extension.rb +++ b/docbook/asciidoctor-macros/cve_idlink-inline-macro/extension.rb @@ -14,11 +14,10 @@ class CVEIdLinkInlineMacro < Extensions::InlineMacroProcessor named :cve_idlink - def process parent, target, attrs - cvename = "CVE-#{target}" - cvenum = target + def process parent, cvenum, attrs + cvename = "CVE-#{cvenum}" suffix = '' - target = %(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-{cvenum}) + 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}) diff --git a/docbook/asciidoctor-macros/ws_buglink-inline-macro.rb b/docbook/asciidoctor-macros/ws_buglink-inline-macro.rb index 185fb390bc..38da3048fc 100644 --- a/docbook/asciidoctor-macros/ws_buglink-inline-macro.rb +++ b/docbook/asciidoctor-macros/ws_buglink-inline-macro.rb @@ -3,6 +3,6 @@ RUBY_ENGINE == 'opal' ? (require 'ws_buglink-inline-macro/extension') : (require_relative 'ws_buglink-inline-macro/extension') -Extensions.register :uri_schemes do +Extensions.register do inline_macro WSBugLinkInlineMacro end diff --git a/docbook/asciidoctor-macros/ws_buglink-inline-macro/extension.rb b/docbook/asciidoctor-macros/ws_buglink-inline-macro/extension.rb index f6509da9a6..3bc22b47be 100644 --- a/docbook/asciidoctor-macros/ws_buglink-inline-macro/extension.rb +++ b/docbook/asciidoctor-macros/ws_buglink-inline-macro/extension.rb @@ -13,17 +13,17 @@ include ::Asciidoctor class WSBugLinkInlineMacro < Extensions::InlineMacroProcessor use_dsl - named :'ws_buglink' + named :ws_buglink + parse_content_as :text name_positional_attributes 'bugtext' - def process parent, target, attrs - bugnum = target + def process parent, bugnum, attrs bugtext = if (attrs['bugtext']) attrs['bugtext'] else - 'Bug' + %(Bug #{bugnum}) end - target = %(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id={bugnum}) + target = %(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=#{bugnum}) if parent.document.basebackend? 'html' parent.document.register :links, target %(#{(create_anchor parent, bugtext, type: :link, target: target).render}) diff --git a/docbook/asciidoctor-macros/ws_salink-inline-macro.rb b/docbook/asciidoctor-macros/ws_salink-inline-macro.rb index 9e82f2854c..055ce64dfd 100644 --- a/docbook/asciidoctor-macros/ws_salink-inline-macro.rb +++ b/docbook/asciidoctor-macros/ws_salink-inline-macro.rb @@ -3,6 +3,6 @@ RUBY_ENGINE == 'opal' ? (require 'ws_salink-inline-macro/extension') : (require_relative 'ws_salink-inline-macro/extension') -Extensions.register :uri_schemes do +Extensions.register do inline_macro WSSALinkInlineMacro end diff --git a/docbook/asciidoctor-macros/ws_salink-inline-macro/extension.rb b/docbook/asciidoctor-macros/ws_salink-inline-macro/extension.rb index c76776bfe7..2c87e4350f 100644 --- a/docbook/asciidoctor-macros/ws_salink-inline-macro/extension.rb +++ b/docbook/asciidoctor-macros/ws_salink-inline-macro/extension.rb @@ -14,10 +14,9 @@ class WSSALinkInlineMacro < Extensions::InlineMacroProcessor named :'ws_salink' - def process parent, target, attrs - sanum = target - satext = "wnpa-sec-#{target}" - target = %(https://www.wireshark.org/security/wnpa-sec-{sanum}) + def process parent, sanum, attrs + satext = "wnpa-sec-#{sanum}" + target = %(https://www.wireshark.org/security/wnpa-sec-#{sanum}) if parent.document.basebackend? 'html' parent.document.register :links, target %(#{(create_anchor parent, satext, type: :link, target: target).render}) diff --git a/docbook/release-notes.asciidoc b/docbook/release-notes.asciidoc index 71eadc3986..dc8bb769b1 100644 --- a/docbook/release-notes.asciidoc +++ b/docbook/release-notes.asciidoc @@ -152,24 +152,24 @@ locations on your system. == Known Problems Dumpcap might not quit if Wireshark or TShark crashes. -(ws-buglink:1419[]) +(ws_buglink:1419[]) The BER dissector might infinitely loop. -(ws-buglink:1516[]) +(ws_buglink:1516[]) Capture filters aren't applied when capturing from named pipes. -(ws-buglink:1814[]) +(ws_buglink:1814[]) Filtering tshark captures with read filters (-R) no longer works. -(ws-buglink:2234[]) +(ws_buglink:2234[]) Application crash when changing real-time option. -(ws-buglink:4035[]) +(ws_buglink:4035[]) Wireshark and TShark will display incorrect delta times in some cases. -(ws-buglink:4985[]) +(ws_buglink:4985[]) -Wireshark should let you work with multiple capture files. (ws-buglink:10488[]) +Wireshark should let you work with multiple capture files. (ws_buglink:10488[]) == Getting Help diff --git a/tools/gen-bugnote b/tools/gen-bugnote index 17962224f0..00b5a057ab 100755 --- a/tools/gen-bugnote +++ b/tools/gen-bugnote @@ -60,7 +60,7 @@ bug_title=$( -e 's/\\/{backslash}/' \ ) -echo -e "* $bug_title (ws-buglink:$bug_id[])\n" \ +echo -e "* $bug_title (ws_buglink:$bug_id[])\n" \ | $recode_cmd \ | $clipboard_cmd