fix formatting of literal default values with spaces
When the RST parser encounters a literal value with spaces before the closing backticks, it misinterprets that as an unclosed literal expression. Fix the logic that used to add quotes around such lines, both to make the values more visible to readers of the documentation and to fix the parsing issue. Change-Id: I1bfd675d6611c59f4b3cc4816d48dbb199340bec Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
11c39ac065
commit
a98f7106e3
|
@ -127,7 +127,7 @@ def _format_defaults(opt):
|
|||
for default_str in defaults:
|
||||
if not isinstance(default_str, six.text_type):
|
||||
default_str = six.text_type(default_str)
|
||||
elif default_str.strip() != default_str:
|
||||
if default_str.strip() != default_str:
|
||||
default_str = '"%s"' % default_str
|
||||
results.append(default_str)
|
||||
return results
|
||||
|
|
Loading…
Reference in New Issue