Skip to content

Commit ef112f8

Browse files
committed
fix: warning command needs an extra line
1 parent 39e7d18 commit ef112f8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/pyconverter/xml2py/ast_tree.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,7 @@ class Caution(Element):
16341634

16351635
def to_rst(self, indent="", max_length=100):
16361636
"""Return a string to enable converting the element to an RST format."""
1637-
lines = ["", "", ".. warning::"]
1637+
lines = ["", "", ".. warning::", ""]
16381638
indent = indent + " " * 4
16391639
lines.append(
16401640
resize_length(
@@ -3033,7 +3033,7 @@ def py_docstring(self, custom_functions: CustomFunctions, warning_command_dict:
30333033
warnings_ = warning_command_dict[self.name]
30343034
for warning_ in warnings_:
30353035
warning_ = textwrap.indent(warning_, " " * 4)
3036-
items.extend([f"\n.. warning::\n{warning_}\n"])
3036+
items.extend([f"\n.. warning::\n\n{warning_}\n"])
30373037

30383038
if self.default is not None:
30393039
if self.default.tag in item_needing_links_base_url:
@@ -3231,7 +3231,7 @@ def trail_replacer(match):
32313231
logger.info(f"{self.name} is an archived command.")
32323232
docstr = (
32333233
docstr
3234-
+ "\n\n.. warning::\n"
3234+
+ "\n\n.. warning::\n\n"
32353235
+ " This command is archived in the latest version of the software.\n"
32363236
)
32373237

tests/customized_functions/inquire.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def inquire(self, strarray="", func="", arg1="", arg2=""):
5656
The ``/INQUIRE`` command is valid in any processor.
5757
5858
.. warning::
59+
5960
Take note that from version 0.60.4 and later, the command behaviour
6061
has been changed.
6162
Previously, the ``StrArray`` argument was omitted. For example:

0 commit comments

Comments
 (0)