Asciidoctor macro fixups.
authorGerald Combs <gerald@wireshark.org>
Tue, 13 Feb 2018 18:25:47 +0000 (10:25 -0800)
committerGerald Combs <gerald@wireshark.org>
Tue, 13 Feb 2018 18:32:56 +0000 (18:32 +0000)
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 <gerald@wireshark.org>
docbook/asciidoctor-macros/cve_idlink-inline-macro.rb
docbook/asciidoctor-macros/cve_idlink-inline-macro/extension.rb
docbook/asciidoctor-macros/ws_buglink-inline-macro.rb
docbook/asciidoctor-macros/ws_buglink-inline-macro/extension.rb
docbook/asciidoctor-macros/ws_salink-inline-macro.rb
docbook/asciidoctor-macros/ws_salink-inline-macro/extension.rb
docbook/release-notes.asciidoc
tools/gen-bugnote

index e2dd67e586782b07db1eae3da02c09ccd3c7a007..fc1a5e2c9fe2ba1fbb9edd841012edeac0950864 100644 (file)
@@ -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
index 1e505d48d037c931f8de1cefb5ec19d486fb569a..fcf1f4ec33ac4e84de4342dc0e2259dd3b6a1928 100644 (file)
@@ -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})
index 185fb390bc88cb6642635c0aca867be92c2118e7..38da3048fc63fc6c929cf1f4c0d37cb7281b5fba 100644 (file)
@@ -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
index f6509da9a69f5b8ee107bf219bcaeda1f669fefe..3bc22b47bee2b17a75bfea28bb73701864b15431 100644 (file)
@@ -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})
index 9e82f2854ce5c02db0d1621c895619f8c891c833..055ce64dfd6aa84278587e5c84aa980003899dbe 100644 (file)
@@ -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
index c76776bfe792fe21b4df303c982f83504ca7fba9..2c87e4350f16a371601b9c5267bb501fe3366b6b 100644 (file)
@@ -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})
index 71eadc3986e8389b35a4021de64bfd9665c179a3..dc8bb769b1073fdc951801c4faed50a9ba9c649d 100644 (file)
@@ -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
 
index 17962224f02a93b4c764197ea5c455546f9a802f..00b5a057abd0ddf7ee5ea4388194f319f77612bc 100755 (executable)
@@ -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