@@ -3779,11 +3779,11 @@
#
# @dstport: #optional destination port - mandatory for udp, optional for ip
#
-# @ipv6: #optional - force the use of ipv6
+# @ipv6: #optional force the use of ipv6
#
-# @udp: #optional - use the udp version of l2tpv3 encapsulation
+# @udp: #optional use the udp version of l2tpv3 encapsulation
#
-# @cookie64: #optional - use 64 bit coookies
+# @cookie64: #optional use 64 bit coookies
#
# @counter: #optional have sequence counter
#
@@ -137,7 +137,8 @@ def texi_body(doc):
desc = str(section)
opt = ''
if "#optional" in desc:
- desc = desc.replace("#optional", "")
+ desc = re.sub(r'^ *#optional *\n?|\n? *#optional *$|#optional',
+ '', desc)
opt = ' (optional)'
body += "@item @code{'%s'}%s\n%s\n" % (arg, opt,
texi_format(desc))