diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/qapi2texi.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index 06d6abfa5a..0f3e5738c8 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -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)) |