diff --git a/nodes.py b/nodes.py index 7c28a92..5ffb520 100644 --- a/nodes.py +++ b/nodes.py @@ -1189,8 +1189,12 @@ def to_asciidoc(self, **kwargs): variable = ["`"] variable.append(memberdef.child("type").to_asciidoc(**kwargs)) variable.append( - f" <<{memberdef.id},{escape_text(memberdef.text('name'))}>>`:: " + f" <<{memberdef.id},{escape_text(memberdef.text('name'))}>>" ) + argsstring = memberdef.text("argsstring") + if argsstring: + variable.append(argsstring) + variable.append("`:: ") briefdescription = memberdef.child("briefdescription").to_asciidoc(**kwargs) if briefdescription: variable.append(briefdescription) diff --git a/tests/test_variable_sectiondef_node.py b/tests/test_variable_sectiondef_node.py index c9a7119..4eac0f6 100644 --- a/tests/test_variable_sectiondef_node.py +++ b/tests/test_variable_sectiondef_node.py @@ -1,3 +1,5 @@ +# pylint: disable=line-too-long + from textwrap import dedent from bs4 import BeautifulSoup from doxygentoasciidoc.nodes import VariableSectiondefNode @@ -30,7 +32,7 @@ def test_to_asciidoc(): """\ ===== Variables - `uint32_t <>`:: {empty}""" + `uint32_t <>[SF_TABLE_V2_SIZE/2]`:: {empty}""" ) @@ -66,3 +68,62 @@ def test_to_details_asciidoc(): [.memname]`uint32_t sf_table[SF_TABLE_V2_SIZE/2]`""" ) + + +def test_bug(): + xml = """\ + + + cyw43_t + cyw43_t cyw43_state + + cyw43_state + + + + + + + + + + void(* + void(* cyw43_poll) (void) + )(void) + cyw43_poll + + + + + + + + + + uint32_t + uint32_t cyw43_sleep + + cyw43_sleep + + + + + + + + + + """ + + asciidoc = VariableSectiondefNode( + BeautifulSoup(xml, "xml").sectiondef + ).to_asciidoc() + + assert asciidoc == dedent( + """\ + ===== Variables + + `<> <>`:: {empty} + `void(++*++ <>)(void)`:: {empty} + `uint32_t <>`:: {empty}""" + )